Add a script to generate code coverage reports after fuzzing - #123079
#123079Merged
Merged
Add a script to generate code coverage reports after fuzzing#123079
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-meta |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds automation for generating code coverage reports from fuzzing inputs. Previously, users had to manually craft commands to collect coverage data from fuzzer-generated inputs. The new collect-coverage.ps1 script automates the entire workflow, including tool installation, assembly instrumentation discovery, PDB file copying, and HTML report generation.
Changes:
- Added PowerShell script to automate coverage collection using coverlet and reportgenerator tools
- Extended Program.cs with
--get-instrumented-assembliesCLI option to support the coverage script - Updated run.bat to dynamically search for DotnetFuzzing.exe instead of using hardcoded paths
- Updated documentation with coverage generation workflow examples
- Expanded .gitignore patterns to exclude coverage reports and corpus directories
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/Fuzzing/README.md | Added documentation section explaining how to generate coverage reports after fuzzing |
| src/libraries/Fuzzing/DotnetFuzzing/run.bat | Changed from hardcoded path to recursive search for DotnetFuzzing.exe |
| src/libraries/Fuzzing/DotnetFuzzing/collect-coverage.ps1 | New PowerShell script that automates coverage collection workflow |
| src/libraries/Fuzzing/DotnetFuzzing/Program.cs | Added --get-instrumented-assemblies option to output assemblies and type prefixes for instrumentation |
| src/libraries/Fuzzing/.gitignore | Updated patterns to ignore input directories, corpus directories, and coverage reports |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
@MihuBot fuzz HttpHeaders -short |
|
Ran the fuzzer(s) successfully. Code coverage reports: |
rzikm
self-requested a review
January 13, 2026 13:01
MihaZupan
added a commit
that referenced
this pull request
Jan 28, 2026
Small follow-up to #123079 for odd setups where the "global" dotnet SDK wouldn't work and we can make it work with the local one. There's also no need to use global tools since our build already installs these as local ones. I had to make these tweaks to get MihuBot fuzzing to work on Helix queues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running the fuzzer will generate lots of test inputs. We already had logic for running a fuzzer over all inputs in a directory
But getting a code coverage report from that involves a bunch of annoying manual steps in crafting the right commands.
The
collect-coverage.ps1script automates them so that you can just runThe powershell is mostly LLM written.