Skip to content

ci(coverage): make the per-file coverage gates real on v2.x (#396) - #523

Merged
adityamukho merged 2 commits into
mainfrom
ci/396-coverage-gates-v2
Oct 10, 2026
Merged

adityamukho merged 2 commits into
mainfrom
ci/396-coverage-gates-v2

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Backport of #522 to main (v2.x). Part of #396, which stays open (durability label, closes on release).

The gate never gated

main has the same broken gate as v3 had: under cargo-llvm-cov the lock tests could not find pid_ns_helper, so no report was written. Every module was logged as "not found in coverage report" and the job passed. It also grepped --text output, which has no per-file percentages.

Now

The changes match #522:

  • Workflow: runs the whole suite with --branch on the pinned nightly-2026-10-01 and fails if any test fails.
  • Checker: scripts/coverage_gates.py checks each file's line and branch floors in coverage-thresholds.toml. A file missing from the report, or one without branch data, fails.
  • Floors: measured on main with a clean target dir, less one point. They cover wal.rs, db.rs, graph/storage.rs, backend/file.rs, btree_v6.rs, cache.rs, index.rs, storage/mod.rs, packed_pages.rs, persistent_facts.rs, evaluator.rs, executor.rs and stratification.rs.
  • Not gated: the legacy v5 btree.rs, which is only read during migration.
  • Floor policy: v2.x only gets data-integrity and security fixes, so these floors hold the line rather than climb.

Tests ported from v3

  • The WAL fact-size test now overwrites the fact's length field, so it reaches MAX_FACT_SIZE (before, it changed bytes inside the fact).
  • A WAL entry that claims more than 1M facts ends replay.
  • WalWriter::open_or_create in a missing directory fails.
  • Two threads that miss the same page in the page cache get the one cached copy. A barrier backend makes this deterministic; before, only a race reached that path, and the gate flapped on v3. The test is skipped on WASI.

Left out

Docs: CHANGELOG (Unreleased → Tests), ROADMAP, TEST_COVERAGE, CLAUDE.md/README test count (1237).

🤖 Generated with Claude Code

https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h

adityamukho and others added 2 commits October 10, 2026 21:53
Backport of #522. 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.

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 (measured on main, less one point) with
scripts/coverage_gates.py.

Port the v3 tests that apply to v2.x: the WAL fact-size test now reaches
the limit, an entry claiming over 1M facts ends replay, a WAL writer in a
missing directory fails, and two threads missing one cache page share
one copy (that path was reached only by a race, so the gate flapped).

Part of #396.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Random-input tests reach a few of its branches only in some runs: 78.6%
locally, 75.7% in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 18a3681 into main Oct 10, 2026
21 checks passed
@adityamukho
adityamukho deleted the ci/396-coverage-gates-v2 branch October 10, 2026 16:37
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
adityamukho added a commit that referenced this pull request Oct 10, 2026
…rage

Merge main into v3: v2.x coverage gates (#523)
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