#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # shellcheck source=scripts/local-debug-env.sh source "$ROOT_DIR/scripts/local-debug-env.sh" export BROWSER_ACCEPTANCE_EVIDENCE_DIR="${BROWSER_ACCEPTANCE_EVIDENCE_DIR:-$LOCAL_DEBUG_ROOT/browser-acceptance}" export LOCAL_DEBUG_PLATFORM_URL="${LOCAL_DEBUG_PLATFORM_URL:-$(local_debug_platform_url)}" export LOCAL_DEBUG_WEB_URL="${LOCAL_DEBUG_WEB_URL:-$(local_debug_web_url)}" SELF_STARTED="${BROWSER_ACCEPTANCE_SELF_START:-true}" cleanup() { if [[ "$SELF_STARTED" == "true" ]]; then LOCAL_DEBUG_ROOT="$LOCAL_DEBUG_ROOT" \ LOCAL_DEBUG_PLATFORM_PORT="$LOCAL_DEBUG_PLATFORM_PORT" \ LOCAL_DEBUG_WEB_PORT="$LOCAL_DEBUG_WEB_PORT" \ "$ROOT_DIR/scripts/local-debug-stop.sh" >/dev/null 2>&1 || true fi } if [[ "$SELF_STARTED" == "true" ]]; then trap cleanup EXIT "$ROOT_DIR/scripts/local-debug-reset.sh" "$ROOT_DIR/scripts/local-debug-start.sh" else curl -fsS "$LOCAL_DEBUG_PLATFORM_URL/healthz" >/dev/null curl -fsS "$LOCAL_DEBUG_WEB_URL" >/dev/null fi "$ROOT_DIR/scripts/local-debug-smoke.sh" mkdir -p "$BROWSER_ACCEPTANCE_EVIDENCE_DIR" node "$ROOT_DIR/platform_web/acceptance/browser-acceptance.mjs"