Fix CI E2E: check Planner DB, add Playwright HTML report

- Integration test DB check now hits Planner API (not Journal)
  so it correctly skips when no PostgreSQL in CI
- Playwright uploads HTML report artifact on all runs (not just failures)
- Install Chromium with --with-deps for CI compatibility
- Report retained for 30 days

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-24 23:47:43 +01:00
parent 2d0a4ac2c7
commit 7d273b73c0
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
3 changed files with 9 additions and 13 deletions

View file

@ -75,13 +75,11 @@ jobs:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm exec playwright install chromium
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm test:e2e
- uses: actions/upload-artifact@v7
if: failure()
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
e2e/results/
playwright-report/
retention-days: 7
path: playwright-report/
retention-days: 30

View file

@ -12,17 +12,15 @@ import { test, expect } from "@playwright/test";
const JOURNAL = "http://localhost:3000";
const PLANNER = "http://localhost:3001";
// Helper: check if DB is available
// Helper: check if DB is available (checks Planner API)
async function isDbAvailable(): Promise<boolean> {
try {
const resp = await fetch(`${JOURNAL}/api/auth/login`, {
const resp = await fetch(`${PLANNER}/api/sessions`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ step: "magic-link", email: "nonexistent@test.com" }),
body: JSON.stringify({}),
});
// If we get a JSON response (even error), DB is available
const body = await resp.json();
return body.error !== undefined || body.step !== undefined;
return resp.ok; // 201 = DB available, 503 = DB unavailable
} catch {
return false;
}

View file

@ -6,7 +6,7 @@ export default defineConfig({
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? "github" : "list",
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",