Repository navigation
ci: fix test-floor ratchet never engaging (base path mismatch) - #224
Conversation
discipline: passedBase
|
53b7500 to
e9d37ef
Compare
Test Results
Benchmark Results
Run Status
Memory (Linux, PHP 8.4)Peak RSS of a child process building one structure, n = 500,000, minus an empty-process floor. Judy's memory advantage is type- and scale-dependent — see BENCHMARK.md for the curve across sizes on a dedicated host.
API Speedups (Linux, PHP 8.4)Speedup = PHP time / Judy time. Bold = Judy faster.
Core Types (Linux, PHP 8.4)Speedup = PHP time / Judy time. Bold = Judy faster.
All types detailCore Types (Linux, PHP 8.4) — AllSpeedup = PHP time / Judy time. Bold = Judy faster.
Release Comparison (2.6.0 → 2.7.1)
Summary: 0 regressions, 100 unchanged
Memory ComparisonMemory: 0 regressions, 10 unchanged
Full benchmark outputLinux — PHP 8.4 |
The ratchet wired in #221 never actually enforced anything. Two bugs: 1. Path mismatch. test_report pointed at reports/junit-head.xml, a filename the merge step generates but that is never committed. In git mode discipline reads the BASE report from the base ref at the same path as test_report, so the lookup always missed and the step passed trivially with "not present in base ref; identity ratchet will be enforced on subsequent changes" -- a promise that could never come true. 2. Serialization mismatch (found on the first live run of the fix). Having pointed test_report at reports/junit.xml, the ratchet then flagged four tests as "dropped" for no reason. Cause: the merge step built the head with xml.dom.minidom.toprettyxml(), which normalizes attribute quoting and HTML-entity escaping (name="...offsetSet's..." instead of name='...offsetSet's...'). The committed baseline is raw run-tests.php output, so every test name containing an apostrophe disagreed with the head and test-floor read it as a drop. Discipline compares the name strings as written, not XML-decoded. Fix both: point test_report at the committed reports/junit.xml baseline (git mode then finds base from the base ref and head from disk at the same path), and merge the head by concatenating the raw <testsuite> blocks from each artifact verbatim, preserving the escaping the baseline uses. Verified with the local v0.18.0 CLI (the same engine CI runs): - fixed wiring, head == baseline: "verified 258 passed base test identity/identities against head report", PASS - minidom-re-serialized head: 4 false "Test Dropped From Suite" errors (the exact names CI flagged) -- reproduced, then fixed by raw concat - one testcase genuinely dropped: caught as Test Dropped From Suite - full local discipline check on the diff: PASS (27 gates)
e9d37ef to
43f4659
Compare
What
Fixes the test-floor identity ratchet wired in #221, which was a silent no-op: it never enforced anything. Two bugs:
1. Path mismatch (inspection)
git mode reads the base report from the base ref at the same path as
test_report, and the head report from disk at that path. Butreports/junit-head.xmlis a name the merge step generates per-run and is never committed — the committed baseline lives atreports/junit.xml. So the base-ref lookup always missed and the step passed trivially:That message's promise could never come true:
junit-head.xmlwill never exist in any base ref. Every PR since #221 passed the ratchet unconditionally, so a count-preserving test drop (the exact attack the ratchet exists to block) would sail through.2. Serialization mismatch (found by the first live run of bug-1's fix)
Pointing
test_reportatreports/junit.xmlmade the ratchet fire — but on four false "drops":increment_string_to_int_hash_001,iterator_next_invalid_behavior_001,prune_expired_reentrancy_001,regression_delete_range_destructor_reentrancy_001. The artifact and baseline names were byte-identical, yet the merged head disagreed. Cause: the merge step built the head withxml.dom.minidom.toprettyxml(), which normalizes attribute quoting/escaping —name='...offsetSet's...'becamename="...offsetSet's...". The committed baseline is raw run-tests.php output ('entities), so every test name containing an apostrophe disagreed with the head, and test-floor compares name strings as written (raw), not XML-decoded:Fix
test_reportat the committedreports/junit.xmlbaseline. Git mode then finds both halves: base from the base ref (reports/junit.xmlis committed on main), head from disk at the same path.<testsuite>blocks from each artifact verbatim (no parse/re-serialize), preserving the exact escaping the baseline uses.Validation (local v0.18.0 CLI — the same engine CI runs)
verified 258 passed base test identity/identities against head report— this is now the live CI result on this PR (test-floor on 258 0, PASS).Test Dropped From Suiteerrors — reproduced locally, then eliminated by raw concat.Test Dropped From Suite.discipline check --base origin/main: PASS (27 gates, 0 errors).The CI run for this PR itself exercises the fix end-to-end: base ref (main) carries the 258-test baseline, the merge step writes the raw-concat head over it, and the ratchet compares them for real — green.