Skip to content

coverage: make crate_features key optional #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

roypat
Copy link
Member

@roypat roypat commented Mar 17, 2025

Currently, if a crate wishes to run the coverage test with some cargo features enabled, it must explicitly list them out in the crate_features key of the coverage json files.

Change this so that if this key is omitted from the json file, then test_coverage.py passes --all-features to cargo.

No functional change, as currently crate_features is a mandatory key, so to opt-in to this new behavior, crates must remove this key from their coverage json file(s).

(even with the switch to codecov.io, I suspect we'll still keep these files around, as we'll still need a way to specify exclusions / feature sets, so I don't think this is throwaway work)

Summary of the PR

Please summarize here why the changes in this PR are needed.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@roypat roypat force-pushed the cov-all-features branch from 2d1b610 to 172cc77 Compare March 17, 2025 10:57
@roypat roypat changed the title coverage: make coverage_features key optional coverage: make crate_features key optional Mar 17, 2025
@roypat roypat force-pushed the cov-all-features branch from 172cc77 to 20c7f0f Compare March 17, 2025 11:02
Currently, if a crate wishes to run the coverage test with some cargo
features enabled, it must explicitly list them out in the
`crate_features` key of the coverage json files.

Change this so that if this key is omitted from the json file, then
test_coverage.py passes `--all-features` to cargo.

No functional change, as currently `crate_features` is a mandatory key,
so to opt-in to this new behavior, crates must remove this key from
their coverage json file(s).

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat force-pushed the cov-all-features branch from 20c7f0f to e184399 Compare March 17, 2025 11:17
@stefano-garzarella
Copy link
Member

LGTM, but should we document this behavior on the main readme or in https://github.com/rust-vmm/rust-vmm-ci/blob/main/coverage_config_x86_64.json.sample ?

Mention that `crate_features` is now optional, and also update a very
outdated reference to `cargo kcov`

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat force-pushed the cov-all-features branch from deeb586 to 9b0cfe2 Compare March 18, 2025 13:57
@roypat
Copy link
Member Author

roypat commented Mar 18, 2025

LGTM, but should we document this behavior on the main readme or in main/coverage_config_x86_64.json.sample ?

Ahh, yes, good catch. The README even still talked about cargo kcov, which we havent been using in ages haha

@roypat roypat merged commit 3ea2d3f into rust-vmm:main Mar 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants