#!/usr/bin/env bash # Playwright-E2E (Projekte api, web, throttle) gegen den laufenden Supabase-Stack im dind (Issue #38, D2). # Voraussetzungen: DOCKER_HOST/DOCKER_GW gesetzt, `supabase start` lief, Extra-GoTrue auf :9998 laeuft, # Web-Build in app/build/web. Die Supabase-Ports liegen im dind; ein TCP-Relay macht sie unter # 127.0.0.1 erreichbar, wie es die Tests und die Web-App (CORS/Origin, Site-URL localhost:3000) erwarten. # Der Spike (SPIKE_GOTRUE_URL) laeuft in CI bewusst nicht. set -euo pipefail : "${DOCKER_GW:?DOCKER_GW (dind-Gateway) fehlt}" : "${SUPABASE_ANON_KEY:?SUPABASE_ANON_KEY fehlt}" node e2e/support/tcp-forward.mjs "$DOCKER_GW" 54321 54322 54324 9998 & relay=$! trap 'kill "$relay" 2>/dev/null || true' EXIT for port in 54321 54322 54324 9998; do for _ in $(seq 1 20); do (exec 3<>"/dev/tcp/127.0.0.1/${port}") 2>/dev/null && break sleep 0.5 done done export SUPABASE_URL=http://127.0.0.1:54321 export MAILPIT_URL=http://127.0.0.1:54324 export E2E_DB_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres export WEB_URL=http://localhost:3000 export THROTTLE_GOTRUE_URL=http://127.0.0.1:9998 export CI=true cd e2e npx playwright test --project=api --project=web --project=throttle