#!/usr/bin/env bash # Row 128 (#1622): the full gate (every package node suite and every scripts/test-*.sh) run in the given # worktree, every output teed to . The compose project is named q128r1 so the one network the Docker # suite leaves is mine to remove, and the trap removes it. # Usage: suites.sh set -u -o pipefail WT=$(cd "$1" && pwd); OUT=$(mkdir -p "$2" && cd "$2" && pwd) cd "$WT" || exit 2 export COMPOSE_PROJECT_NAME=q128r1 docker network ls --format '{{.Name}}' | sort > "$OUT/networks-before.txt" cleanup() { docker network rm q128r1_default >/dev/null 2>&1; docker network ls --format '{{.Name}}' | sort > "$OUT/networks-after.txt"; } trap cleanup EXIT node_suite() { # name dir setsid -w timeout -k 10 900 node --test "$2"/tests/*.test.mjs 2>&1 | tee "$OUT/$1.txt" >/dev/null echo "$1: rc=${PIPESTATUS[0]} $(grep -E '^ℹ (tests|pass|fail) ' "$OUT/$1.txt" | tr '\n' ' ')" } for d in project bus cli webui business mosaic plugins tasks harness seat control-board conversation discord ledger runs; do node_suite $d packages/$d; done for s in scripts/test-*.sh; do n=$(basename "$s" .sh) setsid -w timeout -k 10 1800 bash "$s" 2>&1 | tee "$OUT/$n.txt" >/dev/null echo "$n: rc=${PIPESTATUS[0]} $(grep -iE 'passed|PASS|ok' "$OUT/$n.txt" | tail -1)" done echo done