#!/usr/bin/env bash # Row 294 gate run 3, sage-3199: npm ci (root and packages/webui), suites whole, every # scripts/test-*.sh, then the mutants. Stops at the first red. FROM= resumes at a step # (the mos-1411 single cli rerun uses FROM=cli TAG=-rerun). set -u -o pipefail WT=/mnt/storage/scratch/launchpad-r294/wt OUT=/mnt/storage/scratch/launchpad-r294/run4 FROM=${FROM:-npm-root}; TAG=${TAG:-} export TMPDIR=$(mktemp -d /mnt/storage/scratch/tmp/gXXXXXX) echo "start $(date -u +%H:%M:%SZ) FROM=$FROM TAG=$TAG TMPDIR $TMPDIR head $(git -C $WT rev-parse HEAD)" >> $OUT/summary.txt [ -z "$(git -C $WT status --porcelain)" ] || { echo "STOP worktree not clean" | tee -a $OUT/summary.txt; exit 9; } on=0 step() { # name limit dir cmd... local name=$1 limit=$2 dir=$3; shift 3 [ $on = 1 ] || [ $name = $FROM ] || return 0; on=1 local t0=$(date +%s%N) ( cd $dir && timeout -k 10 $limit "$@" ) > $OUT/$name$TAG.log 2>&1 local rc=$? local ms=$(( ($(date +%s%N) - t0) / 1000000 )); local dt=$((ms/1000)).$(printf %03d $((ms%1000))) echo "$name$TAG rc=$rc seconds=$dt limit=$limit $(date -u +%H:%M:%SZ)" | tee -a $OUT/summary.txt [ $rc -eq 0 ] || { echo "STOP at $name$TAG" | tee -a $OUT/summary.txt; exit $rc; } } step npm-root 900 $WT npm ci --ignore-scripts step npm-webui 900 $WT/packages/webui npm ci --ignore-scripts step webui 600 $WT/packages/webui node --test tests/ step cli 2100 $WT/packages/cli node --test tests/*.test.mjs step bus 900 $WT/packages/bus node --test tests/*.test.mjs declare -A L=([auth]=126 [conductor]=145 [config]=130 [discord]=147 [extension-package]=130 [foundation]=269 [land-work]=171 [queue]=226 [release]=157 [task]=231) for s in auth conductor config discord extension-package foundation land-work queue release task; do step test-$s ${L[$s]} $WT bash scripts/test-$s.sh done [ -z "$(git -C $WT status --porcelain)" ] || { echo "STOP worktree dirty after the scripts" | tee -a $OUT/summary.txt; git -C $WT status --porcelain >> $OUT/summary.txt; exit 9; } echo "SUITES GREEN $(date -u +%H:%M:%SZ)" | tee -a $OUT/summary.txt python3 -B $OUT/mutants.py rc=$?; echo "MUTANTS rc=$rc $(date -u +%H:%M:%SZ)" | tee -a $OUT/summary.txt; exit $rc