0
0
#!/usr/bin/env bash
# On the staging VM, as stg: the gate (tests/gate.sh: every entry of tests/entries.txt, a staging target runs them all)
# against the market network instance stg, as the network's driver accounts (accounts.sh: alice1 to alice4, one gate slot each). Usage: suite.sh <run>
# Its output is the gate's: one "RESULT <runbook>:<entry> PASS|FAIL <seconds> <note>" line each, the summary table and
# "gate: staging: N of M PASS"; exit 1 when one failed. The entries' logs and readings: $D/gate/.
# SWC_COMPAT_REQUESTER (0006:compat's requester, sha:<the previous rc's commit>), GATE_VMS, GATE_FREEZE_TTL, GATE_JOBS and
# GATE_SHARD (i/n: this network's share of the entries, one of n networks side by side; M is then the share's count): the caller's.
set -uo pipefail
. "$(dirname "$0")/accounts.sh"
run=$1
D=${SWC_DIR:-/home/stg/stg}
export SWC_REPO=$D/suite
cd $D/suite/tests
# the target's own log (its stderr): a suite that fails here, before any test, says why (the module brings the logs back)
compositions/staging/target.sh "$run" > $D/target-staging.json 2> $D/target-staging.log || { echo "RESULT target-staging FAIL 0 exit $?"; cat $D/target-staging.log; exit 3; }
rm -rf $D/gate
SWC_HEAVY_HELD=1 GATE_HOST=${SWC_TEST_HOST:-$D/swc-test-host} GATE_OUT=$D/gate GATE_FREEZE_TTL=${GATE_FREEZE_TTL:-300} \
exec ./gate.sh $D/target-staging.json --account ${GATE_ACCOUNTS:-${STG_DRIVERS// /,}}