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:
parent
2d0a4ac2c7
commit
7d273b73c0
3 changed files with 9 additions and 13 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue