Skip to content

ci: build the prod stack and e2e-test it with Playwright#5

Open
gthanasis wants to merge 3 commits into
mainfrom
feat/docker-e2e-ci
Open

ci: build the prod stack and e2e-test it with Playwright#5
gthanasis wants to merge 3 commits into
mainfrom
feat/docker-e2e-ci

Conversation

@gthanasis

Copy link
Copy Markdown
Owner

What

Adds a CI job that builds the production Docker stack and runs an
end-to-end test against it with Playwright.

  • New e2e CI job — builds docker-compose.prod.yml, brings the
    stack up, waits for /health, runs Playwright against the dashboard,
    tears down (with stack logs on failure).
  • Playwright — root playwright.config.ts + e2e/home.spec.ts:
    the home page loads (dashboard title, no runtime error) and the API
    /health endpoint responds. test:e2e script added.
  • docker-compose.prod.yml — distinct project name trader-prod
    so it never collides with the dev docker-compose.yml (which also
    defines a postgres service) on a shared machine.
  • DEPLOY.md — note that POSTGRES_PASSWORD is fixed at DB volume
    initialisation.
  • .dockerignore — exclude env files at any depth (a nested
    .env.local symlink broke next build) and ignore Playwright output.

Validation

Run locally before pushing:

  • Docker image builds clean.
  • The prod stack runs — Prisma migrate, API, web, and the Binance
    liquidation websocket all come up.
  • Playwright passes 3/3 against the freshly-built containers.

🤖 Generated with Claude Code

gthanasis and others added 3 commits May 18, 2026 00:46
- New `e2e` CI job — builds docker-compose.prod.yml, brings the stack
  up, waits for /health, runs Playwright against the dashboard, tears
  down.
- Playwright setup: root config + e2e/home.spec.ts asserting the home
  page loads (dashboard title, no runtime error) and the API /health
  endpoint responds.
- docker-compose.prod.yml: distinct project name `trader-prod` so it
  never collides with the dev docker-compose.yml on a shared machine.
- DEPLOY.md: note that POSTGRES_PASSWORD is fixed at DB volume init.
- .dockerignore: exclude env files at any depth (a nested .env.local
  symlink broke `next build`) and ignore e2e / playwright artefacts.

Validated locally: image builds, the prod stack runs (migrate, API,
web, liquidation websocket), and Playwright passes 3/3 against it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
vitest has no `include` glob, so its default `**/*.spec.ts` matched the
new Playwright spec `e2e/home.spec.ts` and failed the unit-test run
("Playwright Test did not expect test() to be called here"). Exclude
`**/e2e/**` — those specs run via `pnpm test:e2e`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The app title is "Moon Trader" after the open-source rebrand; the spec
still expected "Trader Dashboard".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant