#!/usr/bin/env bash # Post-deploy validation for the QA environment: runs the API integration # suite (real HTTP + real Postgres, seeding/cleaning up its own data) and the # Playwright admin e2e suite against the just-deployed QA stack. Intended to # run immediately after deploy-qa.sh, on the same self-hosted qa runner, so # `localhost` resolves to the deployed containers. set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" && source ./lib.sh cd "$CI_ROOT" ensure_dotnet ensure_node QA_ADMIN_PORT="${QA_ADMIN_PORT:-3001}" BASE_URL="http://localhost:${QA_ADMIN_PORT}" export MICCHECK_API_BASE_URL="$BASE_URL" export MICCHECK_DB_CONNECTION_STRING="${MICCHECK_DB_CONNECTION_STRING:-Host=localhost;Port=55432;Database=miccheck;Username=miccheck;Password=password}" log "Running API integration suite against $BASE_URL" dotnet test tests/api/MicCheck.Api.Tests.Integration/MicCheck.Api.Tests.Integration.csproj -c Release --logger trx log "Installing admin e2e dependencies" npm --prefix src/admin ci npm --prefix src/admin run e2e:install log "Running Playwright admin e2e suite against $BASE_URL" E2E_BASE_URL="$BASE_URL" npm --prefix src/admin run e2e log "smoke-qa.sh complete - QA environment validated end to end"