Specify Poker E2e
Quick Start
- Bring up the full stack:
docker compose up --build -d - Run external E2E tests (hits the compose stack, waits for readiness):
PLAYWRIGHT_EXTERNAL=1 npm --prefix apps/ui run test:e2e
Debug Workflow
Follow this loop until tests pass (prefer fixing root causes, not test retries):
- Re-run just the failing test:
npm --prefix apps/ui run test:e2e -- <test-file> -g "<test name>" - Collect local service logs:
- Tail a single service:
docker compose logs -f gateway - Since a timestamp:
docker compose logs --since 10m gateway player game balance event notify
- Tail a single service:
- Use trace IDs from logs:
- Gateway logs include
traceIdandspanIdfields; use thetraceIdto correlate across services. - Grafana (http://localhost:3001) → Explore → Loki:
{service="gateway"} | json | traceId="<traceId>" - Grafana → Explore → Tempo: paste the
traceIdto open the distributed trace.
- Gateway logs include
Environment Knobs (Playwright)
- Use
PLAYWRIGHT_EXTERNAL=1to disable the PlaywrightwebServerand run against docker-compose. - Use
PLAYWRIGHT_BASE_URLto target a non-default UI URL (defaulthttp://localhost:3000). - Use
PLAYWRIGHT_GATEWAY_URL,PLAYWRIGHT_KEYCLOAK_URL,PLAYWRIGHT_GRAFANA_URL,PLAYWRIGHT_LOKI_URL,PLAYWRIGHT_TEMPO_URLfor non-default service URLs. - Use
PLAYWRIGHT_STACK_TIMEOUT_MS(default120000) orPLAYWRIGHT_SKIP_STACK_WAIT=1to control global stack readiness polling.
Common Failure Patterns
{"error":"ACCOUNT_NOT_FOUND"}when joining a table: check Gateway table-join flow and Balance account provisioning.13 INTERNAL: Table ID is requiredfrom gateway: check WS session-event publishing includes a non-emptytable_id.- Player DB
profiles_pkeyduplicate key errors: check Player profile provisioning usesINSERT ... ON CONFLICT(avoid error-log spam). - Game stuck on
PREFLOP/ “Current Turn” points at an empty seat: inspecthand.turn+ seat statuses and look for duplicate seating; use.codex/skills/specify-poker-game-stall-triage/SKILL.md.
Resources
scripts/
scripts/stack_up.sh: Bring up the stack and print key URLs.
references/
- Prefer the high-level specs in
specs/*.mdand service specs inapps/*/spec/*.mdas the source of truth for E2E behavior.
