Q105 pointed beam/CHECK at pytest; pytest is not installed on this interpreter, so the gate exited 2 and ran zero cells. run_lane_tests.py collects TestCase classes (TestLoader) and bare module-level def test_*() (FunctionTestCase) itself, treats an unimportable module and a printed FAIL transcript as faults, and exits 0/1/2. Four test files that imported pytest now use beam_assert.raises/fail and unittest.mock; no cell dropped. Measured: unittest discover 353 tests; runner 570 (353 + 217 bare); bash wizard-work/beam/CHECK rc 0; test_run_lane_tests.py 10 cells OK; 7-mutant battery in scratch copies all as expected (HEAD CHECK rc 2, broken bare rc 1, pytest import rc 1, failing TestCase rc 1, script FAIL rc 1, empty lane rc 2, control rc 0). Record: WORK-QUEUE.md Q128; report wizard-outputs/volt/2026-10-30-q128.md
46 lines
2.1 KiB
Bash
Executable File
46 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# CHECK: verify all beam reliability primitives
|
|
#
|
|
# Runner note (Q105, 2026-10-28). This lane writes its tests in two styles:
|
|
# unittest.TestCase subclasses and bare module-level `def test_*` / `assert`.
|
|
# `python3 -m unittest discover` collects only the first -- 276 of the 407
|
|
# tests the directory held then -- so a green CHECK said nothing about the
|
|
# other 131, and test_fenwick.py's 8 cells could be broken without moving
|
|
# the gate.
|
|
#
|
|
# Runner note (Q128, 2026-10-30). Q105's repair pointed this gate at pytest,
|
|
# which collects both styles but is not installed on every interpreter the
|
|
# gate runs on: here `python3 -m pytest --version` fails, so the gate printed
|
|
# "pytest not importable -- cannot grade" and exited 2 -- honest, and running
|
|
# zero of the lane's cells. The gate now runs `run_lane_tests.py`, which
|
|
# collects both styles itself on the standard library alone (TestLoader for
|
|
# the TestCase classes, FunctionTestCase for every module-level `def test_*`
|
|
# with no parameters, and one import-by-path step that turns a module which
|
|
# will not import into a fault), so the same cells run with or without
|
|
# pytest. Counts are not pinned here -- the runner prints them every run,
|
|
# and `python3 run_lane_tests.py --list` prints the collection alone.
|
|
#
|
|
# Exit codes follow the repo's tools/ contract: 0 clean, 1 graded a fault
|
|
# (a failing test, an erroring test, a module that will not import), 2 could
|
|
# not grade (no python3, no lane directory, no test files).
|
|
#
|
|
# `toposort/test_toposort.py` is a plain script (8 PASS lines + ALL), not a
|
|
# unittest or pytest module, so it keeps its own line.
|
|
set -e
|
|
set -o pipefail
|
|
cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
set +e
|
|
python3 run_lane_tests.py
|
|
rc=$?
|
|
set -e
|
|
case $rc in
|
|
0) ;;
|
|
1) echo "CHECK: lane tests failed -- see the failure list above (Q105/Q128)." >&2; exit 1 ;;
|
|
2) echo "CHECK: could not grade -- see the runner's message above." >&2; exit 2 ;;
|
|
127) echo "CHECK: python3 not found -- cannot grade." >&2; exit 2 ;;
|
|
*) echo "CHECK: run_lane_tests.py exited $rc -- internal error (a fault)." >&2; exit 1 ;;
|
|
esac
|
|
|
|
python3 toposort/test_toposort.py
|