import { defineConfig, devices } from '@playwright/test'; /** * Hermetic config for the ranking-semantics suite. * * These checks prove tidalDB's product thesis — that writing a signal changes * the order of a query, immediately — against a throwaway standalone node this * suite boots and seeds itself. Nothing here touches the deployed cluster, and * nothing here needs a credential, a kubeconfig, or a network. * * **Why a separate config rather than a project inside `playwright.config.ts`.** * That config's `globalSetup` (`tests/e2e/support/env-bootstrap.ts`) hard-fails * when kubectl cannot reach the cluster, and it must: sourcing credentials from * the cluster is what stops a check silently skipping. Two things rule out * gating it per-project: * * 1. `FullConfig.projects` handed to `globalSetup` is NOT filtered by * `--project` (measured: selecting one of two projects still reports both), * so setup cannot tell whether a cluster-targeted test was even selected. * 2. `globalSetup` publishes credentials into `process.env` of the MAIN process * so forked workers inherit them. A Playwright setup *project* runs inside a * worker, where that propagation does not happen. * * Separate configs keep each suite's prerequisites honest: this one requires * nothing, and the regression config keeps failing loudly when the cluster is * unreachable. Same split the demo suite already uses. */ export default defineConfig({ testDir: './tests/e2e/features', testMatch: ['10-ranking-semantics.spec.ts'], timeout: 180_000, expect: { timeout: 20_000 }, forbidOnly: !!process.env.CI, // Each test boots its own node, so a retry would hide a genuine ordering bug // behind a second roll of the dice — the same reasoning as the regression // config. If a ranking assertion is unstable, the assertion is wrong. retries: 0, workers: 1, fullyParallel: false, reporter: process.env.CI ? [ ['github'], ['html', { open: 'never', outputFolder: 'playwright-report-semantics' }], ['junit', { outputFile: 'test-results/playwright-semantics-junit.xml' }], ] : [['list'], ['html', { open: 'never', outputFolder: 'playwright-report-semantics' }]], outputDir: 'test-results/playwright-semantics', use: { // No baseURL: the app's origin is allocated per test by the harness, so a // config-level default would be a lie. actionTimeout: 20_000, navigationTimeout: 45_000, trace: 'retain-on-failure', screenshot: 'only-on-failure', video: 'retain-on-failure', }, projects: [ { name: 'semantics', use: { ...devices['Desktop Chrome'] }, }, ], });