From f4681da876700723dc049e21ac35ee31732253d4 Mon Sep 17 00:00:00 2001 From: mrleo1nid <43583385+mrleo1nid@users.noreply.github.com> Date: Thu, 29 Oct 2026 23:17:48 +0300 Subject: [PATCH] Stabilize E2E server and retain failure diagnostics --- .gitea/workflows/ci-ts.yml | 9 +++++++++ apps/web/playwright.config.ts | 7 ++++++- apps/web/vite.config.ts | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-ts.yml b/.gitea/workflows/ci-ts.yml index 88d05ef..8571988 100644 --- a/.gitea/workflows/ci-ts.yml +++ b/.gitea/workflows/ci-ts.yml @@ -63,3 +63,12 @@ jobs: pnpm --filter @pipu/web exec playwright install --with-deps chromium || pnpm --filter @pipu/web exec playwright install chromium - run: pnpm --filter @pipu/web test:e2e + - name: E2E failure diagnostics + if: failure() + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: web-e2e-failure + path: apps/web/test-results/ + if-no-files-found: ignore + retention-days: 3 diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts index a6ce167..31cd81d 100644 --- a/apps/web/playwright.config.ts +++ b/apps/web/playwright.config.ts @@ -3,7 +3,12 @@ import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './e2e', timeout: 30_000, - use: { baseURL: 'http://127.0.0.1:4173', ...devices['Desktop Chrome'] }, + use: { + baseURL: 'http://127.0.0.1:4173', + ...devices['Desktop Chrome'], + trace: 'retain-on-failure', + screenshot: 'only-on-failure', + }, webServer: { command: 'pnpm exec vite --port 4173 --strictPort', url: 'http://127.0.0.1:4173', diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index fd75c74..6739da0 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -8,6 +8,9 @@ export default defineConfig({ target: 'es2022', }, server: { + // E2E installs a stateful fake API in the page. A dev-server reload would + // discard it in the middle of a scenario (including other parallel workers). + hmr: process.env.VITE_E2E === '1' ? false : undefined, host: '127.0.0.1', port: 5173, strictPort: true,