Pulse/tests/integration/playwright.config.ts
rcourtman c728539f07 Restore completed Core E2E verdicts: shard CI, drop release tag from test image
Every main push since the v6 branch flip was cancelled at the 45-minute
job timeout with no verdict. The flip brought the full 94-spec suite onto
main (the last green run, 2026-06-29, ran only 2 specs on the v5 main),
and it runs sequentially against a release-tagged image whose mock-fixture
gate returns 403 without a demo entitlement. Dozens of specs fail, retry
twice each, and burn the budget: of the 31 minutes of suite time in run
28907574469, 18.8 minutes were failing attempts.

- Add GO_BUILD_TAGS build arg (default release) and build the pulse:test
  e2e image with it empty, matching the dev harness the suite is green
  under. Shipped images keep the release tag; release-gate behavior keeps
  its dedicated -tags release Go tests.
- Shard Playwright 4 ways across a CI matrix (214/202/205/203 tests per
  shard) with per-shard report artifacts and an aggregate verdict job.
- Cap CI at 20 failures so an env-broken run reports red in minutes
  instead of grinding into a no-verdict cancellation.
2026-07-08 08:00:55 +01:00

109 lines
3 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import { preferredBrowserBaseURL } from './tests/runtime-defaults';
/**
* Playwright configuration for Pulse update integration tests
* See https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: false, // Update tests should run sequentially
/* Fail the build on CI if you accidentally left test.only in the source code */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* On CI, a broken test environment fails most of the suite; abort early so
the run produces a red completed verdict with a report instead of
grinding until the job timeout cancels it with no verdict at all. */
maxFailures: process.env.CI ? 20 : 0,
/* Opt out of parallel tests on CI */
workers: 1, // Update tests modify global state
/* Reporter to use */
reporter: [
['html', { outputFolder: 'playwright-report', open: 'never' }],
['list'],
['junit', { outputFile: 'test-results/junit.xml' }]
],
/* Shared test timeout */
timeout: 60000, // Updates can take time
expect: {
timeout: 10000,
},
/* Shared settings for all projects */
use: {
/* Base URL for all tests */
baseURL: preferredBrowserBaseURL(),
/* Allow testing against self-signed TLS when explicitly enabled */
ignoreHTTPSErrors: ['1', 'true', 'yes', 'on'].includes(
String(process.env.PULSE_E2E_INSECURE_TLS || '').trim().toLowerCase(),
),
/* Collect trace when retrying the failed test */
trace: 'on-first-retry',
/* Screenshot on failure */
screenshot: 'only-on-failure',
/* Video on failure */
video: 'retain-on-failure',
/* Default navigation timeout */
navigationTimeout: 15000,
/* Default action timeout */
actionTimeout: 10000,
},
/* Configure projects for different browsers */
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
// Mobile-specific tests are intentionally excluded from the desktop project;
// they rely on mobile viewports where md:hidden nav is visible, tables overflow, etc.
testIgnore: ['**/04-mobile.spec.ts'],
},
{
name: 'mobile-chrome',
use: {
...devices['Pixel 5'],
},
// Journey tests skip on mobile projects (all use test.skip for mobile-*),
// so exclude them to avoid unnecessary browser launches.
testIgnore: ['**/journeys/**'],
},
{
name: 'mobile-safari',
use: {
...devices['iPhone 12'],
},
testIgnore: ['**/journeys/**'],
},
// Uncomment to test on Firefox and WebKit
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
],
/* Run local dev server before starting the tests */
// We use docker-compose instead, managed via npm scripts
webServer: undefined,
});