Skip to content

Fix E2E Playwright CI failures: gateway HTTP routing and missing service initialization#60

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-action-job-error
Draft

Fix E2E Playwright CI failures: gateway HTTP routing and missing service initialization#60
Copilot wants to merge 2 commits intomainfrom
copilot/fix-action-job-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

28 E2E tests fail in CI because login never succeeds — the gateway's port 80 redirects all non-health requests to HTTPS (breaking browser API calls), and no admin user is ever created because required env vars aren't set.

Root causes

  • Gateway port 80 → HTTPS redirect: NEXT_PUBLIC_GATEWAY_URL=http://localhost:80 sends browser calls to the port 80 server block, which only serves /health and redirects everything else to https://api.wildbox.local/... — unresolvable in CI. Port 8080 (the actual HTTP API server) was not exposed to the host.
  • No admin user: INITIAL_ADMIN_EMAIL/INITIAL_ADMIN_PASSWORD not set → identity service skips creation. Tests hardcode superadmin@wildbox.com / wildbox123.
  • Services misconfigured: DATABASE_URL, JWT_SECRET_KEY, POSTGRES_PASSWORD, and secondary DB URLs all unset in CI → identity can't connect or sign tokens; data/guardian/responder services start before their databases exist.

Changes

docker-compose.yml

  • Expose gateway port 8080 (the HTTP API server block with actual routes)
  • Set NEXT_PUBLIC_GATEWAY_URL=http://localhost:8080 and INTERNAL_GATEWAY_URL=http://open-security-gateway:8080 so both browser and SSR requests use the working HTTP gateway

.github/workflows/test.yml (E2E job only)

  • Add "Create CI environment file" step that writes .env before docker compose up:
    POSTGRES_PASSWORD=postgres
    DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/identity
    DATA_DATABASE_URL=postgresql://postgres:postgres@postgres:5432/data
    JWT_SECRET_KEY=ci-test-jwt-secret-key-not-for-production
    INITIAL_ADMIN_EMAIL=superadmin@wildbox.com
    INITIAL_ADMIN_PASSWORD=wildbox123
    CREATE_INITIAL_ADMIN=true
    ...
    
  • Restructure "Start services" to start postgres/redis first, create secondary databases (data, guardian, responder) via psql before launching remaining services — eliminating the race condition where services attempt DB connections before their databases exist

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…atabase setup

Co-authored-by: fabriziosalmi <1569108+fabriziosalmi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix action job error without breaking functionality Fix E2E Playwright CI failures: gateway HTTP routing and missing service initialization Feb 21, 2026
Copilot AI requested a review from fabriziosalmi February 21, 2026 08:33
@github-actions
Copy link

Integration Test Results

1 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0   1 🔥 ±0 

For more details on these errors, see this check.

Results for commit 3346d4b. ± Comparison against base commit 49b04a5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants