diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57a2f263..9809973e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,10 +67,13 @@ jobs: [ "$ran" = "$declared" ] || { echo "unittest ran $ran of $declared declared tests"; exit 1; } # Each file must also RUN its tests when invoked directly, the way a # human and the old CI step do. A file without a __main__ block exits 0 - # having run nothing, so only the reported count proves anything. + # having run nothing, so the reported count is checked; and a file that + # fails on its own, but passes after the modules that run before it in + # the full run (an environment they leave set), fails here: its exit + # status was dropped until 2026-09-24. for f in $(cd tests && ls test_*.py | sed 's/\.py$//' | sort); do d=$(grep -c 'def test_' "tests/$f.py") - o=$(python3 "tests/$f.py" 2>&1 || true) + o=$(python3 "tests/$f.py" 2>&1) || { echo "$f.py fails when run on its own:"; echo "$o" | tail -20; exit 1; } r=$(echo "$o" | grep -oE 'Ran [0-9]+' | grep -oE '[0-9]+' || echo 0) echo " $f.py run directly: ran $r of $d" [ "$r" = "$d" ] || { echo "$f.py ran $r of its $d tests when invoked directly"; exit 1; }