23 lines
1.7 KiB
Bash
Executable File
23 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# Row 67 round 1, Darkwing's mutants. Usage: mutants.sh <tree> ; one edit, one test file, restore.
|
||
set -u
|
||
T=$1; M=$HOME/darkwing-scratch/rv67/mut.mjs
|
||
export TMPDIR=$HOME/darkwing-scratch/rv67/tmp
|
||
B=packages/bus/src/broker.mjs; S=packages/webui/src/serve.mjs
|
||
run() { # name file from to testfile
|
||
local name=$1 file=$2 from=$3 to=$4 tf=$5
|
||
( cd "$T" && node "$M" "$file" "$from" "$to" >/dev/null ) || { echo "$name: did not apply"; return; }
|
||
local out; out=$(cd "$T" && node --test "$tf" 2>&1)
|
||
local p f; p=$(grep -E '^ℹ pass' <<<"$out" | awk '{print $3}'); f=$(grep -E '^ℹ fail' <<<"$out" | awk '{print $3}')
|
||
echo "$name: pass $p fail $f"; grep -E '^✖ ' <<<"$out" | grep -v 'failing tests' | sed 's/ ([0-9.]*ms)//' | sort -u | sed 's/^/ /'
|
||
( cd "$T" && git checkout -q -- "$file" )
|
||
}
|
||
date -u +%FT%TZ
|
||
run view-business-null $B " blocking: !!d.blocking," " blocking: !!d.blocking, business: null," packages/bus/tests/decisions.test.mjs
|
||
run closed-drop-by $B 'SELECT * FROM decision_events WHERE decision=? AND op IN ${CLOSED} ORDER BY seq DESC LIMIT 1' 'SELECT seq, decision, op FROM decision_events WHERE decision=? AND op IN ${CLOSED} ORDER BY seq DESC LIMIT 1' packages/bus/tests/decisions.test.mjs
|
||
run recent-order-raise $B 'ORDER BY x.seq DESC LIMIT ${RECENT}' 'ORDER BY d.seq DESC LIMIT ${RECENT}' packages/bus/tests/decisions.test.mjs
|
||
run auth-target-task-ref $B 'target: context.target,' 'target: d.task_ref ?? context.target,' packages/bus/tests/decisions.test.mjs
|
||
run web-list-recent-only $S "const DECISION_LISTS = ['roles', 'recent'];" "const DECISION_LISTS = ['recent'];" packages/webui/tests/bus.test.mjs
|
||
date -u +%FT%TZ
|
||
( cd "$T" && git status --short packages/bus/src packages/webui/src )
|