cargo: exclude all test code from coverage instrumentation - #10104
Open
thoughtpolice wants to merge 6 commits into
Open
cargo: exclude all test code from coverage instrumentation#10104thoughtpolice wants to merge 6 commits into
thoughtpolice wants to merge 6 commits into
Conversation
This is just a nice shorthand for running `llvm-cov` with some options that exclude some "extra" code (testing, build.rs, etc) that the default exclusions do not pick up, which slightly perturbs the numbers. Signed-off-by: Austin Seipp <aseipp@pobox.com>
Used in upcoming diffs to reduce coverage reports over test code. Signed-off-by: Austin Seipp <aseipp@pobox.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Also adds a note on excluding test modules from reports. Signed-off-by: Austin Seipp <aseipp@pobox.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I have a branch where I was investigating adding many Hegel proptests across the codebase. My goal was to find bugs and see how coverage increased, but I realized in the midst of that, that we still included far too much test code itself in the coverage report generated by
cargo llvm-covwith the default settings (and so adding more hegel tests would skew things). Fix those settings with a default we can all rely on, exclude test modules throughout the codebase from participating in coverage reports, and add some notes on how to run coverage for users (I always forget this).Checklist
If applicable:
CHANGELOG.mdREADME.md,docs/,demos/)cli/src/config-schema.json)how it works, how it's organized), including any code drafted by an LLM.
an eye towards deleting anything that is irrelevant, clarifying anything
that is confusing, and adding details that are relevant. This includes,
for example, commit descriptions, PR descriptions, and code comments.