27 lines
2.2 KiB
Bash
Executable File
27 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# Dewey's row 91 round 3 gate and mutants. Gate on ~/dewey-scratch/r91 (2b2a9e14 + build.patch staged),
|
||
# mutants on ~/dewey-scratch/r91mut. Only test-task gets the dead Docker socket.
|
||
set -u
|
||
O=~/dewey-scratch/r91-out; W=~/dewey-scratch/r91; M=~/dewey-scratch/r91mut
|
||
export TMPDIR=~/dewey-scratch/tmp
|
||
busy(){ for p in $(pgrep -f -- --test) $(pgrep -f "scripts/test-"); do [ "$p" = "$$" ] && continue; c=$(readlink /proc/$p/cwd 2>/dev/null) || continue; case "$(cat /proc/$p/comm 2>/dev/null)" in node*|bash) ;; *) continue;; esac; case "$c" in $HOME/dewey-scratch/*) ;; *) return 0;; esac; done; return 1; }
|
||
if busy; then echo "BUSY, abort" >> $O/summary.txt; exit 9; fi
|
||
cd $W || exit 2
|
||
echo "start $(date -u +%Y-%m-%dT%H:%M:%SZ) base $(git rev-parse HEAD) staged=$(git diff --cached --name-only | wc -l)" >> $O/summary.txt
|
||
sha256sum -c --quiet $O/candidate-manifest.sha256 && echo "manifest 8/8 OK" >> $O/summary.txt || { echo "manifest mismatch" >> $O/summary.txt; exit 3; }
|
||
for p in tasks bus harness webui cli business seat control-board; do
|
||
case $p in seat|webui) g="packages/$p/tests/";; *) g="packages/$p/tests/*.test.mjs";; esac
|
||
node --test "$g" > $O/gate/node-$p.txt 2>&1; rc=$?
|
||
echo "node $p rc=$rc $(grep -E '^ℹ (tests|pass|fail|skipped)' $O/gate/node-$p.txt | tr '\n' ' ') $(grep -c '✖' $O/gate/node-$p.txt)x" >> $O/summary.txt
|
||
done
|
||
for f in scripts/test-*.sh; do n=$(basename $f .sh)
|
||
if [ $n = test-task ]; then DOCKER_HOST=unix:///nonexistent.sock bash $f > $O/gate/$n.txt 2>&1; else bash $f > $O/gate/$n.txt 2>&1; fi; rc=$?
|
||
echo "$n rc=$rc $(tail -1 $O/gate/$n.txt | cut -c1-100)" >> $O/summary.txt
|
||
done
|
||
echo "suites end $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $O/summary.txt
|
||
cd $M || exit 2
|
||
sha256sum -c --quiet $O/candidate-manifest.sha256 || { echo "mut manifest mismatch" >> $O/summary.txt; exit 3; }
|
||
LOG=$O/mut bash $O/mutants.sh $O/mut.mjs > $O/mutants.txt 2>&1; echo "mutants rc=$? end $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $O/summary.txt
|
||
sha256sum -c --quiet $O/candidate-manifest.sha256 && git status --porcelain | grep -v '^M ' | grep -v '^A ' | wc -l | sed 's/^/mut copy manifest OK, stray entries: /' >> $O/summary.txt || echo "mut copy NOT restored" >> $O/summary.txt
|
||
echo "done $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $O/summary.txt
|