Repository navigation
ci(coverage): make the per-file coverage gates real, add branch gates (#396) - #522
Merged
Merged
Conversation
…#396) The gate never checked anything: the instrumented test run failed (lock tests could not find pid_ns_helper), the report was empty, and every module was skipped with a warning. It also parsed `--text` output, which has no per-file percentages, and named btree_v6, gone on v3. Run the suite with branch coverage on a pinned nightly, fail on a test failure, and check line and branch floors per file from coverage-thresholds.toml with scripts/coverage_gates.py. A file missing from the report, or without branch data, fails. The thresholds file lists the paths left uncovered on purpose. Add tests for the uncovered error paths in wal.rs, packed_pages.rs, persistent_facts.rs and btree.rs; fix the WAL fact-size test, which never reached the limit. Part of #396. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Only a race between two loading threads reached the double-check after the write lock, so cache.rs branch coverage moved between runs and the gate failed in CI (73.3% < 75%). A backend that holds both reads at a barrier makes both threads miss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
The concurrent-miss test's backend stubs count as uncovered lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
This was referenced Oct 10, 2026
adityamukho
added a commit
that referenced
this pull request
Oct 10, 2026
All conflicts resolved to v3's side: v3 has its own coverage gates, thresholds, tests and docs from #522. src/storage/cache.rs auto-merged a second copy of the concurrent-miss test; kept v3's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #396 (stays open:
durabilitylabel, closes on release).The gate never gated
On every run,
coverage-gates.ymlprintedWARNING: <file> not found in coverage reportfor all seven modules and passed:cargo llvm-cov --text … || truefailed partway: the docker/NFS lock tests could not findpid_ns_helperunder cargo-llvm-cov's target dir, so no report was written.--textis annotated source with no per-file percentages, so thegrepfound nothing.btree_v6no longer exists on v3.coverage-thresholds.tomlthat did not exist.Now
pid_ns_helperthe wayllvm-cov.ymldoes, runs the whole suite with--branchon a pinned nightly (nightly-2026-10-01), and fails if any test fails.scripts/coverage_gates.pyreadscargo llvm-cov report --json --summary-onlyand checks each file's line and branch percentage againstcoverage-thresholds.toml. A file missing from the report, or one without branch data, fails.coverage-thresholds.tomlis the single source of truth. It covers the WAL,db.rs,fact_log.rs,log_writer.rs,graph/storage.rs, everysrc/storagefile, and the evaluator, executor and stratification. Each floor is the measured value minus one point (no slack at 100%). The file also lists the paths left uncovered on purpose:holds_every_page() == falsepathsNew tests for uncovered error paths
wal.rspacked_pages.rspersistent_facts.rsbtree.rsindex.rstest_wal_fact_size_limitwas broken: it overwrote bytes inside the fact, not its length, so it never reachedMAX_FACT_SIZE. It now targets the length field. The remaining branch misses inbtree.rsandpersistent_facts.rsare mostly INT-049 invariants and branches inside test helpers, which llvm-cov counts too.Notes
docs/TEST_COVERAGE.md): stale binaries intarget/llvm-cov-targetfrom an older toolchain or cargo-llvm-cov get merged into the report and zero out functions with#[cfg(test)]fault sites. CI always starts clean.mainhas the same vacuous gate. I left it alone: v2.x only takes data-integrity and security fixes.Docs: CHANGELOG (Tests), ROADMAP, TEST_COVERAGE, CLAUDE.md/README test count (1422).
🤖 Generated with Claude Code
https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h