From 322794b1eeaafa8f85e411d898a39b78ab0ad424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ign=C3=A1cio=20Fontoura=20Solla?= Date: Thu, 30 Jul 2026 14:20:14 -0300 Subject: [PATCH] fix(e2e-ci): serve the production build in CI instead of next dev The first full e2e run on the parallel pipeline hit the 30-min timeout: dev-mode cold webpack compiles per route, a __webpack_modules__ TypeError, and dev-server memory-threshold restarts. CI now builds (NEXT_DIST_DIR matches the webServer env) and playwright webServer runs `pnpm start`; local spec development keeps `pnpm dev`. --- .github/workflows/ci-pr.yml | 8 ++++++++ .github/workflows/ci.yml | 5 +++++ playwright.config.ts | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 9a00b6b4..e3bdaf49 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -261,6 +261,14 @@ jobs: if: steps.scope.outputs.mode != 'none' run: pnpm db:seed:minimal + # CI e2e runs against the production build (see playwright.config.ts + # webServer.command); the dist dir must match the webServer env. + - name: Build for e2e + if: steps.scope.outputs.mode != 'none' + run: pnpm build + env: + NEXT_DIST_DIR: .next/e2e + - name: E2E tests (full suite) if: steps.scope.outputs.mode == 'full' run: pnpm test:e2e diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a041c6a..2510cb79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,5 +132,10 @@ jobs: - run: pnpm migrate - run: pnpm db:seed:minimal + - name: Build for e2e + run: pnpm build + env: + NEXT_DIST_DIR: .next/e2e + - name: E2E tests (full suite) run: pnpm test:e2e diff --git a/playwright.config.ts b/playwright.config.ts index a9efe28d..38559d44 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -90,7 +90,14 @@ export default defineConfig({ }, ], webServer: { - command: 'pnpm dev', + /* + * CI serves the PRODUCTION build (`pnpm start` after a `pnpm build` step in + * the e2e job): dev-mode cold webpack compiles per route plus dev-server + * memory restarts made the full suite blow the 30-min job timeout on CI + * (measured 2026-07-30 — first full e2e run on the parallel pipeline). + * Locally `pnpm dev` stays: no build wait and hot reload while writing specs. + */ + command: process.env.CI ? 'pnpm start' : 'pnpm dev', /* * Never reuse a dev server a developer may already have running against the * production database — always start a fresh one bound to the test DB.