Clean stale coverage objects so CI measures the real strict surface #291
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/coverage-strict-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The strict coverage job in CI measured a wider surface than a local run and scored about twenty points lower, and the gap grew between merges with no change in tests (#249). The cause is stale instrumented objects. The coverage job restores a cached
target/, the target began withcargo llvm-cov clean --workspace, and that leaves behind objects built under an older cargo layout. llvm-cov then counted the leftover set as a second, never executed copy of every file it knew about.The CI log shows it directly: files that existed when the cache was written were counted twice at about half coverage (
cli/pr.rs1555 regions at 54%), while files added since were counted once (api/admin.rsat 98%). The covered region counts matched a local run exactly; only the denominator was inflated. That is also why the number drifted: every edit to an old file moved it further from its stale copy.make coverage-strictnow starts with a fullcargo llvm-cov clean. On this branch the runner went from 59758 regions at 67.79% lines to 46074 regions at 89.40%, the same surface a local run reports, and the job took no longer (2m38s). With the two in agreement the floor moves from the provisional 60 to 88, about a point under the observed number.I first tried measuring only the unit-test binary (
--bin fj), on the theory that the binary the integration tests spawn was the second copy. That changed nothing on the runner and is reverted here; the first two commits are that detour and can be squashed away.Local runs need cargo-llvm-cov 0.9 or newer. 0.8 misses the test binary under the pinned nightly's build layout and reports about 2%, which is noted in CLAUDE.md.
Closes #249
WIP: Measure strict coverage on the unit-test binary onlyto Clean stale coverage objects so CI measures the real strict surface