a suite that reports its count against tests is counted

ava writes "94 tests passed" — the number is attached to `tests`, not to the
verb — so every rule that reads the word before passed/failed found `tests`
there and came away with nothing. Three repos in the fleet test, pass, and
would have been failed by the verdict for reporting nothing.

A verdict is only worth having if it is believed, and a false refusal spends
that faster than a missed one. Fixtures are captured from the two repos.
This commit is contained in:
zooqueen
2026-08-16 23:54:12 -07:00
parent 79af3932e0
commit c26a5d840a
2 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -1317,7 +1317,7 @@ jobs:
run: |
set -euo pipefail
NOTHING='\[no test files\]|\[no tests to run\]|no tests ran|collected 0 items|No tests found|no test specified|running 0 tests|Tests:[[:space:]]+0 total|(^|[^0-9])0 (passing|passed)'
SOMETHING='^[[:space:]]*--- (PASS|FAIL|SKIP):|^(ok|FAIL)[[:space:]]+[^[:space:]]+[[:space:]]+([0-9.]+s|\(cached\))([[:space:]]+coverage)?$|[1-9][0-9]* (passed|failed|passing|failing)|test result: (ok|FAILED)\.[[:space:]]+[1-9]|Tests:[[:space:]]+[1-9]'
SOMETHING='^[[:space:]]*--- (PASS|FAIL|SKIP):|^(ok|FAIL)[[:space:]]+[^[:space:]]+[[:space:]]+([0-9.]+s|\(cached\))([[:space:]]+coverage)?$|[1-9][0-9]* (passed|failed|passing|failing)|[1-9][0-9]* tests? (passed|failed)|test result: (ok|FAILED)\.[[:space:]]+[1-9]|Tests:[[:space:]]+[1-9]'
# The runners this estate actually invokes, as they are spelled in a
# `run:`. A gate matching this has told us it tests; nothing else has.
# Read against the COMMANDS only — a whole-line comment is dropped first,
@@ -1388,6 +1388,10 @@ jobs:
else if ($0 ~ /^[=[:space:]]*[0-9]+ (passed|failed|error)/) r += num($0,"passed") + num($0,"failed")
else if ($0 ~ /[0-9]+ passed/ && $0 ~ /[0-9]+ failed/) r += num($0,"passed") + num($0,"failed")
else if ($0 ~ /^[[:space:]]*(DONE|Ran) [0-9]+ tests?/) r += num($0,"tests") ? num($0,"tests") : num($0,"test")
# ava says "94 tests passed" — the count is attached to `tests`,
# not to the verb, so the rules that read the word before
# passed/failed find `tests` there and come away with nothing.
else if ($0 ~ /^[[:space:]]*[0-9]+ tests? (passed|failed)/) r += num($0,"tests") ? num($0,"tests") : num($0,"test")
else if ($0 ~ /^[[:space:]]*[0-9]+ (passing|failing)([[:space:]]|$|\()/) r += num($0,"passing") + num($0,"failing")
else if ($0 ~ /^[[:space:]]*[0-9]+ (pass|fail)([[:space:]]|$)/) r += num($0,"pass") + num($0,"fail")
}
+5
View File
@@ -48,6 +48,11 @@ t "cargo" 5 "test result: ok. 5 passed; 0 failed; 0 ign
t "cargo, with failures" 7 "test result: FAILED. 5 passed; 2 failed; 0 ignored"
t "rust -v" 3 "test tally::a ... ok" "test tally::b ... FAILED" "test tally::c ... ignored"
t "mocha" 415 " 412 passing (2s)" " 3 failing"
# ava attaches the count to `tests` rather than to the verb, so the rules that
# read the word before passed/failed find `tests` there. Both captured from the
# fleet: hanzoai/openid-client and hanzoai/insights-node.
t "ava" 94 " 94 tests passed"
t "ava, with a failure" 94 " 1 test failed" " 93 tests passed"
t "bun test, per case" 4 "(pass) api > get [0.52ms]" "(pass) api > put [0.3ms]" "(pass) api > del [0.2ms]" "(fail) api > patch [0.1ms]"
t "TAP" 2 "ok 1 - the first" "not ok 2 - the second"
t "a bin/*_test.sh suite" 17 " ok clean repo is green" " ok the mark is refused" "" "vendormark_test: 17 passed, 0 failed"