Skip to content

Code coverage for the fuzzers #1873

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Code coverage for the fuzzers #1873

wants to merge 2 commits into from

Conversation

folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Apr 21, 2025

Backporting lessons from zlib-rs

The comment below has a table with the flags (see dropdown). The coverage percentage itself is not too interesting, but the delta may be in the future. The real advantage is that you can now see whether the fuzzer actually hits the logic you expect.

Doing some clicking through the interface, this is the coverage for fuzz-packet_parsing_sound: https://app.codecov.io/github/pendulum-project/ntpd-rs/commit/b560a6393de61168dde532292c01bf5480e22af9/tree/ntp-proto/src?flags%5B0%5D=fuzz-packet_parsing_sound&dropdown=coverage

E.g. here you can see that the fuzzer is unable to generate a valid NtsEncryptedField:

https://app.codecov.io/github/pendulum-project/ntpd-rs/commit/b560a6393de61168dde532292c01bf5480e22af9/blob/ntp-proto/src/packet/extension_fields.rs?flags%5B0%5D=fuzz-packet_parsing_sound&dropdown=coverage#L660

At this point I'm not that familiar with the details of the codebase, so you'll have to look at the results here to see if anything jumps out. It's straightforward to add more fuzzers, and they all run in parallel so CI time does not increase if you do so.

Copy link

codecov bot commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.63%. Comparing base (5cbf2c0) to head (148689b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1873      +/-   ##
==========================================
+ Coverage   81.59%   81.63%   +0.03%     
==========================================
  Files          67       68       +1     
  Lines       21998    21178     -820     
==========================================
- Hits        17950    17289     -661     
+ Misses       4048     3889     -159     
Flag Coverage Δ
fuzz-packet_parsing_sound 5.45% <ø> (?)
fuzz-record_encode_decode 2.90% <ø> (?)
test-aarch64-apple-darwin 81.59% <ø> (?)
test-x86_64-unknown-linux-gnu 81.50% <ø> (?)
test-x86_64-unknown-linux-musl 81.50% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@folkertdev folkertdev requested a review from rnijveld April 21, 2025 19:29
@folkertdev folkertdev changed the title Improve codecov Code coverage for the fuzzers Apr 21, 2025
@davidv1992
Copy link
Member

Thanks for doing this for us. Integration is going to take me a bit more time than I currently can spend, but this is definitely going to come in handy in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants