import { defineConfig, devices } from '@playwright/test'; /** * Regression config for the deploy-verification suite. * * This suite verifies a LIVE deployment (`orchard9-k3sf`, namespace * `tidaldb-cluster`) against docs/runbooks/deploy-verification.md. It is not a * unit suite and it does not boot an application — there is no `webServer`, * because the thing under test is already running in a cluster. * * Consequences of testing a live system, all deliberate: * * - `workers: 1`. The suite opens kubectl port-forwards and writes to a real * quorum. Parallel workers would fight over local ports and interleave * writes into shared state, turning a real regression into a flake. * - `retries: 0`, even on CI. A retry here would mask exactly the kind of * intermittent cluster fault this suite exists to catch. * - Long timeouts. Port-forward establishment plus a quorum-acked write across * three nodes is legitimately slower than a local HTTP call. * * CLI hazard: passing `--reporter=...` REPLACES this reporter array rather than * merging with it. Never add a `test:*` script that passes `--reporter` if a * custom reporter is introduced later. */ export default defineConfig({ testDir: './tests/e2e', // The demo suite has its own config; the ranking-semantics suite has its own // too (playwright.semantics.config.ts) because it is hermetic and must not be // gated on this config's cluster prerequisites. testIgnore: ['**/demo/**', '**/features/10-ranking-semantics.spec.ts'], globalSetup: './tests/e2e/support/env-bootstrap.ts', timeout: 120_000, expect: { timeout: 20_000 }, forbidOnly: !!process.env.CI, // A live-cluster check that only passes on the second attempt has told you // something true about the cluster. Do not hide it. retries: 0, workers: 1, fullyParallel: false, reporter: process.env.CI ? [ ['github'], ['html', { open: 'never', outputFolder: 'playwright-report' }], ['junit', { outputFile: 'test-results/playwright-junit.xml' }], ] : [['list'], ['html', { open: 'never', outputFolder: 'playwright-report' }]], outputDir: 'test-results/playwright', use: { // No global baseURL: this suite deliberately talks to several distinct // origins (public ingress, port-forwarded pod, Grafana, Alertmanager) and a // default would make which-origin bugs invisible. actionTimeout: 20_000, navigationTimeout: 45_000, trace: 'retain-on-failure', screenshot: 'only-on-failure', video: 'retain-on-failure', }, projects: [ { name: 'verification', use: { ...devices['Desktop Chrome'] }, }, ], });