Skip to content

fix(ci): measure coverage over all test targets, not just --lib - #26

Merged
h4x0r merged 1 commit into
mainfrom
fix/coverage-all-test-targets
Aug 4, 2026
Merged

fix(ci): measure coverage over all test targets, not just --lib#26
h4x0r merged 1 commit into
mainfrom
fix/coverage-all-test-targets

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Completes the fleet rollout — these two were held back when the other twelve landed, because their mains were red and a gate change can't be verified against a build that doesn't run. Both are green now.

cargo llvm-cov --lib builds only the lib target's own unit tests. Integration tests under tests/ are separate crates producing separate binaries, so --lib never builds them and records nothing they cover — narrowing the claim from "this code is tested" to "this code is tested from inside src/". bluetooth-forensic reported 54 lines uncovered on a library its own integration tests cover to 100%.

Binary shells are excluded rather than counted: dropping --lib pulls src/bin/ in at 0% (built by the test profile, never executed), which would make the gate unsatisfiable for reasons unrelated to test quality.

Verified against each repo's own gate, since they differ — usb-forensic uses --fail-uncovered-lines 0, peripheral-forensic walks the lcov and honours // cov:unreachable. Both pass.

usb-forensic's gate was also checked for the failure mode this session kept finding — a gate that can't go red. Appending four deliberately uncovered lines makes it exit 1; removing them makes it exit 0. Live, not vacuous.

Completes the fleet rollout. These two repos were held back when the other
twelve landed, because their mains were red at the time and a gate change
cannot be verified against a build that does not run. Both are green now.

`cargo llvm-cov --lib` builds only the lib target's own unit tests. Integration
tests under tests/ are separate crates producing separate binaries, so `--lib`
never builds them and records nothing they cover -- which silently narrows the
claim the gate makes from "this code is tested" to "this code is tested from
inside src/". bluetooth-forensic reported 54 lines uncovered on a library its
own integration tests cover to 100%.

Binary shells are excluded rather than counted: dropping `--lib` pulls src/bin/
into the report at 0% (built by the test profile, never executed), which would
make the gate unsatisfiable for reasons unrelated to test quality.

Verified against each repo's own gate rather than a generic one, since they
differ: usb-forensic gates with `--fail-uncovered-lines 0`, peripheral-forensic
walks the lcov and honours `// cov:unreachable`. Both pass.

usb-forensic's gate was also checked for the failure mode this session kept
finding -- a gate that cannot go red. Appending four deliberately uncovered
lines makes it exit 1; removing them makes it exit 0. It is live, not vacuous.
@h4x0r
h4x0r merged commit fc25d15 into main Aug 4, 2026
13 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.

1 participant