#!/usr/bin/env bash set -euo pipefail umask 077 ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" PROXY_PID="" cleanup() { local status=$? trap - EXIT if ! node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" complete; then status=1; fi if [[ -n "$PROXY_PID" ]]; then kill "$PROXY_PID" 2>/dev/null || true wait "$PROXY_PID" 2>/dev/null || true fi exit "$status" } trap cleanup EXIT trap 'exit 130' INT trap 'exit 143' TERM ip link set lo up ip link add qaonline type veth peer name qapeer ip addr add 192.0.2.1/30 dev qaonline ip addr add 192.0.2.2/30 dev qapeer ip link set qaonline up ip link set qapeer up node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" initialize node "$ROOT_DIR/scripts/qa/browser-environment-probe.mjs" native mkdir "$QA_MANAGED_SCRATCH/tmp" "$QA_MANAGED_SCRATCH/storage" export TMPDIR="$QA_MANAGED_SCRATCH/tmp" STORAGE_DIR="$QA_MANAGED_SCRATCH/storage" python3 "$ROOT_DIR/scripts/qa/local-postgres-proxy.py" "$QA_MANAGED_SOCKET/.s.PGSQL.5432" & PROXY_PID=$! node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" verify bash "$ROOT_DIR/scripts/qa/run-web-gates.sh" "$1"