prove-guard.sh reads only one order of failure summary, so node --test falls through to a count that false-fires exit 3 #18
Labels
No Label
P0
P1
P2
release-blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Project-Template#18
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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 failure count preferred the runner's own summary via one pattern:
That matches
1 failed(vitest, pytest, Gradle) and nothing else. Runners that put the number on the right print no match:ℹ fail 1(node --test),Failures: 2(Maven, JUnit),failures=2(python unittest),# fail 1(TAP). Every one of those fell through to counting lines matching$PROVE_GUARD_FAIL_PATTERN.What it costs
The fallback is not conservative, and
[ "$COUNT" -gt 1 ]exits 3. A guard over a status enum, mutating the string'FAILED', matchesFAIL_PATTERNthree times inside a singleAssertionErrordiff:End-to-end against
node --test, one failing test, a guard behaving perfectly:Exit 3 tells the author to "narrow the guard, or narrow the mutation" — so the script's advice, followed, weakens a correct guard. The script's own header records this exact false fire being tried and rejected ("a naive count calls that six coincidental failures. Tried that first; it fired on the very first run against a guard that was behaving perfectly"), but it stayed reachable through the fallback.
The message compounded it: it printed "this runner printed no summary" about a runner that printed one the script could not read.
GUARDS.mdalready asserts "the failure count comes from the runner's own summary rather than from eyeballing red" — for these runners that claim was false.What to do
Keep the existing pattern first, add a second reading the number on the right (
\bfail(ure)?s?[:= ]+[0-9]+, last match wins), and only then fall back to the approximate count.Traps
tail -1matters: a test name containingfail:earlier in the log would otherwise win over the summary.[:= ]class is what picks up python unittest'sfailures=2;[: ]alone misses it.Verify:
bash prove-guard.sh status.js "'FAILED'" "'MUTATED'" node --test status.test.jsexits 0 and reports "by the runner's summary" where it previously exited 3; a two-failing-test command still exits 3; vitest, pytest and Gradle summaries still resolve through the first pattern.