Artifact 3a799c011d70114ca01d2e2c4e811f1dc1d315c34f50c366497dc7f00ddd665e:
- File
tools/suites.sh
— part of check-in
[c3280ef4fa]
at
2026-11-14 10:41:54
on branch trunk
— The test gate runs in half an hour, not eighty minutes, and loses nothing
make check now runs the unit program and the four shell suites side by side, each to its own log, then prints them in the fixed order and fails if any failed. JOBS=1 gives the old one-after-another order, and a machine with fewer than four cores gets it by default. In test/store.sh the two sync fault sweeps and the clone fault loop run one worker per fault, each with its own remote and machines under a private folder of the same depth, so the same code paths run as before.
Measured on a loaded machine: make check 847 s to 276 s, make cover to 83 s, the whole four-run gate to 30 minutes.
Nothing was removed, renamed, skipped or made to assert less. The list of case names is identical before and after, the counts are unchanged, and coverage is still 100% in 23 files. No product code changed.
Two new targets. make quick SUITE=NAME runs one suite three ways: as it is, with no user name set, and under a strict umask; it is the first thing to run after touching a suite. make gate runs the whole local gate as one command.
One test fixed. a-link-already-gone-is-dropped-quietly looked for the bare text s1 in the ledger, which the scratch folder's random name can contain, so it failed about once in a few hundred runs. It now looks for the link's full path, and requires both no output and the path gone, where before any output at all let it pass.
1269 unit checks, 428 shell cases, 669 store cases, 612 placement cases and 378 project cases, under clang, under gcc 16, with no user name set, and under a strict umask. (user: dmestas, size: 2151) [annotate] [blame] [check-ins using]
#!/bin/sh # Run the unit program and the four shell suites, side by side up to JOBS at a # time (JOBS=1: one after another, the old behaviour), each to its own log in # BUILD_DIR/logs. Then print the logs in a fixed order (unit, run.sh, store.sh, # place.sh, project.sh) and exit non-zero if any suite failed or printed no # summary line. # usage: suites.sh BUILD_DIR [SUITE...] (BUILD_DIR holds suit and unit) # SUITE is one of unit run store place project; with none, all five. set -u if [ "${1:-}" = --one ]; then # the worker: suites.sh --one BUILD_DIR NAME dir=$2 name=$3 case $dir in /*) ;; *) dir=$PWD/$dir ;; esac start=$(date +%s) case $name in unit) "$dir/unit" ;; *) SUIT=$dir/suit sh "test/$name.sh" ;; esac >"$dir/logs/$name.log" 2>&1 echo $? >"$dir/logs/$name.rc" echo $(($(date +%s) - start)) >"$dir/logs/$name.sec" exit 0 fi dir=${1:?usage: suites.sh BUILD_DIR [SUITE...]} shift case $dir in /*) ;; *) dir=$PWD/$dir ;; esac jobs=${JOBS:-1} want=${*:-unit run store place project} rm -rf "$dir/logs" mkdir -p "$dir/logs" build/tmp trap 'exit 130' INT TERM # longest first, so the slowest suite starts at once order= for n in store place project run unit; do case " $want " in *" $n "*) order="$order $n" ;; esac done if [ "$jobs" -le 1 ]; then for n in $order; do sh "$0" --one "$dir" "$n"; done else # shellcheck disable=SC2086 printf '%s\n' $order | xargs -P "$jobs" -n 1 sh "$0" --one "$dir" fi status=0 times= for n in unit run store place project; do case " $want " in *" $n "*) ;; *) continue ;; esac cat "$dir/logs/$n.log" rc=$(cat "$dir/logs/$n.rc" 2>/dev/null || echo missing) times="$times $n $(cat "$dir/logs/$n.sec" 2>/dev/null || echo '?')s" if [ "$n" = unit ]; then pat='^unit: [0-9]* checks, [0-9]* failed$' else pat="^$n.sh: [0-9]* cases, [0-9]* failed\$"; fi if [ "$rc" != 0 ]; then echo "suites: $n exited $rc" >&2; status=1 elif ! grep -q "$pat" "$dir/logs/$n.log"; then echo "suites: $n printed no summary line" >&2; status=1 fi done echo "suites (JOBS=$jobs, seconds):$times" exit $status