testparse: jest names come only from "●" lines under a FAIL header; real jest fixtures

Jest without a TTY prints "FAIL jt/add.test.js" with one space; the parser
matched two, so a real jest load failure read ERROR, not UNVIABLE. The old
`^ +● ` denylist also named process.exit's "●  process.exit called with "1""
as a killing test (CAUGHT). Names now need a FAIL file header above them; a
crash with no named failing test is ERROR. The "no test counts recognised"
line names jest. The synthetic jest logs and mock are replaced by real jest
29.7.0 output captured on Yggdrasil from tools/fixtures/mutation-probe/jsr
(green, wrong, load, exit runs in logs/jest-real.log).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-01 18:14:45 +02:00
commit f68bd4099f
6 changed files with 212 additions and 24 deletions

View file

@ -77,13 +77,19 @@ tp_scan() {
}
jest = 1; next
}
# vitest and jest print " FAIL <file>" for a file and " FAIL <file> > <suite> > <test>" (vitest,
# optionally with a "|project|" prefix) for a test. A line with no " > " names a FILE: a vitest load
# failure ("<file> [ <file> ]"), or a jest file header whose tests are named by the "●" lines below.
/^ *FAIL / { name = $0; sub(/^ *FAIL +/, "", name); print (name ~ / > / ? "FAILED " : "LOADFAIL ") name; next }
/^ +● / { # jest failure block header: " ● suite › test"
# vitest and jest print "FAIL <file>" for a file and " FAIL <file> > <suite> > <test>" (vitest,
# optionally with a "|project|" prefix) for a test. Vitest and a jest TTY pad the word with two spaces;
# jest without a TTY, which is how every job runs it, prints ONE ("FAIL jt/add.test.js"). A line with
# no " > " names a FILE: a vitest load failure ("<file> [ <file> ]"), or a jest file header whose
# tests are named by the "●" lines below it.
/^ *FAIL +/ { infail = 1; name = $0; sub(/^ *FAIL +/, "", name); print (name ~ / > / ? "FAILED " : "LOADFAIL ") name; next }
/^ *PASS +/ || /^Test Suites:/ { infail = 0 }
# jest failure block header " ● suite › test". It names a test only under a FAIL file header: a "●"
# elsewhere is output of the run itself (process.exit prints "● process.exit called with ..." with no
# FAIL header at all), and a crash that names no test stays unnamed, so callers read it as ERROR.
/^ +● / {
name = $0; sub(/^ +● +/, "", name)
if (name !~ /^(Test suite failed to run|Console|Validation Warning|Deprecation)/) print "FAILED " name
if (infail && name !~ /^(Test suite failed to run|Console|Validation Warning|Deprecation)/) print "FAILED " name
next
}
/^(=+ )?(no tests ran|[0-9]+ [a-z]+(, [0-9]+ [a-z]+)*) in [0-9.]+s( \([0-9:]+\))?( =+)?$/ { # pytest summary, with or without -q