Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #371 +/- ##
==========================================
- Coverage 86.99% 79.02% -7.98%
==========================================
Files 25 23 -2
Lines 8860 5239 -3621
Branches 0 242 +242
==========================================
- Hits 7708 4140 -3568
+ Misses 1152 1022 -130
- Partials 0 77 +77
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 |
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.
|
@ValuedMammal did you trigger copilot to do this one? just curious, I haven't tried using it yet. Seems odd to have @copilot as the author. |
|
Looks like this PR needs to be rebased also. |
|
@copilot rebase |
doesn't seem to work the same as dependabot |
Yeah I did. It saved me from doing the work but now it's a bit awkward because someone needs to fixup the commits. |
- 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 - Also add lcov.info to .gitignore to prevent accidental commits
5aaa70b to
527037c
Compare
|
ACK 527037c |
| RUSTFLAGS: "--cfg coverage_nightly" | ||
| - name: Generate HTML coverage report | ||
| run: genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info | ||
| run: cargo llvm-cov --all-features --branch --quiet --ignore-filename-regex "test_utils" --html |
There was a problem hiding this comment.
Why not reusing the lcov.info file to produce a report with genhtml or something similar?
What's the purpose of keeping the html file in the artifacts if the .info file is enough for codecov?
If it is for auditing reasons, why not keeping only the lcov.info files instead of the bloated html?
There was a problem hiding this comment.
I would remove the html file generation altogether and keep only the lcov.info as artifacts. If we want to review them later we can pull them locally and generate an html ourselves. This avoids adding the lcov tools suite to the CI.
I can apply the changes if there are no concerns.
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.