-
Notifications
You must be signed in to change notification settings - Fork 111
[codec] Simple codec roundtrip fuzz harness #1092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[codec] Simple codec roundtrip fuzz harness #1092
Conversation
codec/fuzz/Cargo.toml
Outdated
path = ".." | ||
|
||
[[bin]] | ||
name = "codec" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: In other places, might there be multiple fuzz targets? Then maybe this should carry the same name as the file path for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we are already in codec
, I wonder if it makes sense to just call this roundtrip
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, migrated name to roundtrip
in 9dbe561.
codec/fuzz/Cargo.toml
Outdated
path = ".." | ||
|
||
[[bin]] | ||
name = "codec" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we are already in codec
, I wonder if it makes sense to just call this roundtrip
?
Cargo.toml
Outdated
|
||
# Fuzz deps | ||
libfuzzer-sys = { version = "0.4.9" } | ||
arbitrary = { version = "1.4.1", features = ["derive"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for consistency we should:
- just do
crate = version
- only specify features in the crate that is importing the shared dep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9f629c3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @patrick-ogrady ?
Once the lint is resolved, we can merge. Will take a look shortly. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #1092 +/- ##
==========================================
+ Coverage 90.99% 91.02% +0.03%
==========================================
Files 191 191
Lines 55227 55316 +89
==========================================
+ Hits 50255 50354 +99
+ Misses 4972 4962 -10 see 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This change introduces a basic libfuzzer style roundtrip encode/decode fuzzer to the codec crate using
cargo-fuzz
.The shared
FUZZING.md
doc outlines the process to run the fuzzer with multiple workers, configure different options and export basic coverage information.This approach can be used with the same harness setup across different crates.