#!/usr/bin/env bash
# Run from a current-main checkout after vp i. Place the supplied config at
# scripts/e2e.config.ts and scenario at scripts/scenarios/expanded-tool-output-readable.e2e.ts.
set -euo pipefail
: "${T3_PROOF_OUTPUT_DIR:?Set to a new scratch directory}"
browser_binary=$(find "${PLAYWRIGHT_BROWSERS_PATH:-$HOME/.cache/ms-playwright}" -type f -name chrome-headless-shell | sort | tail -1)
"$browser_binary" --no-sandbox --disable-gpu --remote-debugging-address=127.0.0.1 --remote-debugging-port=19226 --user-data-dir="$T3_PROOF_OUTPUT_DIR/browser" about:blank > "$T3_PROOF_OUTPUT_DIR/browser.log" 2>&1 &
browser_pid=$!
trap 'kill "$browser_pid" 2>/dev/null || true' EXIT
T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/expanded-tool-output-readable.e2e.ts --base 01c84c7c021e78de74a378afbe97e4f4ae33c9c6 --head a899a28a2ca86a7fddf3ab506852f163e190c2ca
