From 7b0c64ef47b914dbbde88005b43ad61b2007c0cd Mon Sep 17 00:00:00 2001 From: Albert Hui Date: Tue, 4 Aug 2026 14:04:07 -0700 Subject: [PATCH] fix(ci): measure coverage over all test targets, not just --lib 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. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41a953c..e3f553d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: components: llvm-tools-preview - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # v2.7.8 - run: cargo install cargo-llvm-cov - - run: cargo llvm-cov --lib --fail-uncovered-lines 0 --show-missing-lines + - run: cargo llvm-cov --fail-uncovered-lines 0 --show-missing-lines --ignore-filename-regex '(^|/)src/(main\.rs|bin/)' msrv: name: MSRV (1.96)