Conversation
- Updated .github/workflows/code_coverage.yml to use cargo-llvm-cov instead of grcov - Removed environment variables (RUSTFLAGS, RUSTDOCFLAGS, LLVM_PROFILE_FILE) - Switched to nightly toolchain for coverage generation - Enabled coverage_nightly config attribute in lib.rs - Added coverage(off) attribute to all test modules to exclude them from coverage reports - Added lint config for coverage_nightly cfg to Cargo.toml Co-authored-by: ValuedMammal <95981133+ValuedMammal@users.noreply.github.com>
Also add lcov.info to .gitignore to prevent accidental commits Co-authored-by: ValuedMammal <95981133+ValuedMammal@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #371 +/- ##
==========================================
- Coverage 85.33% 77.85% -7.49%
==========================================
Files 24 22 -2
Lines 8335 4927 -3408
Branches 0 233 +233
==========================================
- Hits 7113 3836 -3277
+ Misses 1222 1021 -201
- Partials 0 70 +70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Concept ACK, haven't done an in-depth review. |
|
@copilot When running the |
Added --branch flag to enable branch coverage tracking Added --quiet flag to reduce output verbosity Co-authored-by: ValuedMammal <95981133+ValuedMammal@users.noreply.github.com>
Done in commit 5ffaacc. Added |
ValuedMammal
left a comment
There was a problem hiding this comment.
Looks good to me. I'd only suggest redoing the commits to follow the contribution guidelines before merging. The drop in coverage is expected, since we were previously reporting coverage for non-library test code.
Description
Replaces
grcovwithcargo-llvm-covfor coverage generation.grcovlacks branch coverage support and has other limitations.Workflow changes:
cargo-llvm-covRUSTFLAGS="--cfg coverage_nightly"during coverage runs onlylcovtools and old coverage environment variables--branchflag--quietflag to reduce output verbosityCode changes:
coverage_attributefeature via#[cfg_attr(coverage_nightly, feature(coverage_attribute))]inlib.rs#[cfg_attr(coverage_nightly, coverage(off))]on 13 test modulescoverage_nightlyto[lints.rust]inCargo.tomlto declare the custom cfgStable builds are unaffected. Coverage exclusions only activate when the cfg is set.
Notes to the reviewers
The
coverage_nightlycfg is only set during coverage generation in CI. Regular builds and tests use stable toolchain without this cfg.Branch coverage is now explicitly enabled, providing more detailed coverage metrics than the previous grcov setup.
Changelog notice
Checklists
All Submissions:
just pbefore pushingNew Features:
Bugfixes:
Original prompt
cargo-llvm-cov#366💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.