Repository navigation
fix(coverage): dedupe the per-test map before its row cap and cut whole tests - #4331
Conversation
|
🔍 2 things to check
Coverage: 3 uncovered changed linesPatch coverage 95.4% (63 of 66 changed executable lines covered)
Report from this run for 🧾 Evidence: 1 to look at, 6 not known
AI review is paused: this repository reached its monthly spending limit. Bot settings 📊 See the full report for this PR Settings and updatesUpdated 2026-10-21 09:32 UTC, since the last push: health 5.5 to 5.4 |
d1f13d4 to
b727c23
Compare
4bda75a to
73cd1f3
Compare
b727c23 to
9c91913
Compare
73cd1f3 to
35864bc
Compare
9c91913 to
c3b12e7
Compare
35864bc to
bff9dd8
Compare
…le tests in a stable order save_test_coverage sliced the records at the 250k cap before deduping, so at the cap later tests and files vanished in whatever order the report listed them, a test could be cut part way and still look measured, and the CLI counted duplicates and cut rows together as "dropped". cap_test_map (pure) merges a repeated (test, file) pair, lines unioned, before the cap, then keeps whole tests in a stable order (test file, then test id): the test that reaches the cap is kept whole and every later one is left out whole. A truncated map therefore stores at least the cap's rows, which is what tells test selection to run every test. The write is one bulk delete and batched bulk inserts (a 250k-pair map: 24.5 s to 8.7 s), and coverage add reports merged records and the tests left out.
…st map is truncated Test selection already ran every test once the map reached its row cap, but the missing-test signal and test impact read the same map as complete: a file whose covering tests were cut read as an untested change or a stale test, and its gaps were reported. map_is_truncated is now the one check (pair count at or past the cap, which a whole-test cut guarantees) for test selection, the missing-test signal and test impact. On a truncated map the missing-test signal files an uncovered change or an unedited covering test as no data, and test impact's coverage block degrades with per_test_coverage_map_truncated so its gaps are withheld.
bff9dd8 to
2717897
Compare
save_test_coveragesliced the records at the 250k cap before deduping. At the cap, later tests and files vanished in report order, a test could be cut part way and still look measured, andcoverage addcounted duplicates and cut rows together.cap_test_map(pure) merges a repeated (test, file) pair before the cap, unioning its lines. It then keeps whole tests in a stable order (test file, then test id). The test that reaches the cap is kept whole, and every later test is left out whole.map_is_truncatedcheck keeps firing and test selection runs every test.coverage addreports merged records and the tests left out.Stacked on #4328.
Verification
tests/unit/{persistence,analysis,server/mcp}plus the coverage and impacted-tests CLI tests: 9,029 passed.ruff checkclean.