Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add a script to generate code coverage reports after fuzzing - #123079

#123079
Merged
rzikm merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
MihaZupan:fuzzer-coverageMihaZupan/runtime:fuzzer-coverageCopy head branch name to clipboard
Jan 14, 2026
Merged

Add a script to generate code coverage reports after fuzzing#123079
rzikm merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
MihaZupan:fuzzer-coverageMihaZupan/runtime:fuzzer-coverageCopy head branch name to clipboard

Conversation

@MihaZupan

@MihaZupan MihaZupan commented Jan 12, 2026

Copy link
Copy Markdown
Member

Running the fuzzer will generate lots of test inputs. We already had logic for running a fuzzer over all inputs in a directory

dotnet run HttpHeadersFuzzer inputs

But getting a code coverage report from that involves a bunch of annoying manual steps in crafting the right commands.
The collect-coverage.ps1 script automates them so that you can just run

.\collect-coverage.ps1 HttpHeadersFuzzer inputs

The powershell is mostly LLM written.

@MihaZupan MihaZupan added this to the 11.0.0 milestone Jan 12, 2026
@MihaZupan MihaZupan self-assigned this Jan 12, 2026
Copilot AI review requested due to automatic review settings January 12, 2026 01:48
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 12, 2026
@MihaZupan MihaZupan added area-Meta and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 12, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-assemblies CLI 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

Comment thread src/libraries/Fuzzing/DotnetFuzzing/Program.cs
Comment thread src/libraries/Fuzzing/.gitignore
Comment thread src/libraries/Fuzzing/DotnetFuzzing/collect-coverage.ps1
Comment thread src/libraries/Fuzzing/DotnetFuzzing/collect-coverage.ps1
Comment thread src/libraries/Fuzzing/DotnetFuzzing/collect-coverage.ps1
@MihaZupan

This comment was marked as outdated.

@MihaZupan

This comment was marked as outdated.

@MihuBot

This comment was marked as outdated.

@MihaZupan

This comment was marked as outdated.

@MihaZupan

Copy link
Copy Markdown
Member Author

@MihuBot fuzz HttpHeaders -short

@MihuBot

MihuBot commented Jan 13, 2026

Copy link
Copy Markdown

Ran the fuzzer(s) successfully. Code coverage reports:

@rzikm
rzikm self-requested a review January 13, 2026 13:01

@rzikm rzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rzikm
rzikm merged commit 73294eb into dotnet:main Jan 14, 2026
89 checks passed
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.
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.