Skip to content

Commit 5f0bb84

Browse files
opt no-coverage crates out of the coverage gate
cargo-coverage-gate maps any gated package that produces NO coverage data to Verdict::ConfigError (exit 2) unless it is explicitly opted out via `min-lines-percent = 0`. automation (script-only, entirely coverage(off)), fundle (macro re-exports + marker structs + trait defs, no executable bodies), and testing_aids (whole crate coverage(off)) all legitimately produce no data, so the full-workspace gate failed even though every measured package passed. Add `[package.metadata.coverage-gate] min-lines-percent = 0` to the three so the gate treats their NO DATA as OK. This is also the marker anvil-llvm-cov's impact-scoping uses to drop opted-out packages from the measured set. With this, `cargo coverage-gate` over the per-config lcovs reports "all packages meet their threshold" (exit 0). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 531f6d4 commit 5f0bb84

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

crates/automation/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ publish = false
2020
# ohno/serde/etc.
2121
allowed_external_types = ["*"]
2222

23+
# Script-only crate: its entry points are `#![cfg_attr(coverage_nightly,
24+
# coverage(off))]`, so it produces no coverage data. Opt out of the gate
25+
# (min-lines-percent = 0 -> the gate treats NO DATA as OK rather than a config
26+
# error).
27+
[package.metadata.coverage-gate]
28+
min-lines-percent = 0
29+
2330
[dependencies]
2431

2532
duct = { workspace = true }

crates/fundle/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ repository = "https://github.com/microsoft/oxidizer/tree/main/crates/fundle"
2020
[package.metadata.cargo_check_external_types]
2121
allowed_external_types = ["fundle_macros::*"]
2222

23+
# Facade crate: only macro re-exports, marker structs, and trait definitions --
24+
# no executable bodies, so it produces no coverage data. Opt out of the gate.
25+
[package.metadata.coverage-gate]
26+
min-lines-percent = 0
27+
2328
[package.metadata.docs.rs]
2429
all-features = true
2530

crates/testing_aids/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ include = { workspace = true }
2222
# opentelemetry/tracing/etc.
2323
allowed_external_types = ["*"]
2424

25+
# Test-helper crate: the whole crate is `#![cfg_attr(coverage_nightly,
26+
# coverage(off))]` (its utilities are exercised opportunistically by other
27+
# crates' tests), so it produces no coverage data. Opt out of the gate.
28+
[package.metadata.coverage-gate]
29+
min-lines-percent = 0
30+
2531
[dependencies]
2632
futures = { workspace = true, features = ["executor"] }
2733
opentelemetry = { workspace = true, features = ["metrics"] }

0 commit comments

Comments
 (0)