Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,32 @@ runs:

- name: Install dependencies
shell: bash
run: yarn install
run: yarn install --immutable

- name: Build dependencies
shell: bash
run: npx nx run-many -t ci:build

# Cache the Chromium binary (~120MB) keyed on the resolved Playwright
# version, so it isn't re-downloaded every shard/run. Browser versions are
# pinned to the Playwright package version, so the version is the correct
# cache key. On a hit, `playwright install` finds the browser present and
# only installs OS deps.
- name: Resolve Playwright version
id: playwright-version
shell: bash
run:
echo "version=$(cd packages/app && node -p
"require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key:
${{ runner.os }}-playwright-${{
steps.playwright-version.outputs.version }}

- name: Install Playwright browsers
shell: bash
run: cd packages/app && npx playwright install --with-deps chromium
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
jobs:
e2e-tests:
name: E2E Tests - Shard ${{ matrix.shard }}
runs-on: ubuntu-24.04
# 8-core runner so the 4 Playwright workers (see playwright.config.ts) have
# CPU headroom alongside the app + ClickHouse + MongoDB — 4 workers
# over-subscribed the 4-vCPU ubuntu-24.04 runner and caused timeouts.
runs-on: 8-core-playwright
timeout-minutes: 15
permissions:
contents: read
Expand Down
12 changes: 11 additions & 1 deletion packages/api/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
jest.retryTimes(1, { logErrorsBeforeRetry: true });
// Overridable via JEST_RETRY_TIMES (e.g. the nightly zero-retry flake hunt).
// Honours an explicit 0 so retries can be forced off; an unset/blank/negative/
// non-integer value falls back to the default of 1 rather than coercing to 0.
const rawJestRetries = process.env.JEST_RETRY_TIMES;
const parsedJestRetries = rawJestRetries ? Number(rawJestRetries) : NaN;
jest.retryTimes(
Number.isInteger(parsedJestRetries) && parsedJestRetries >= 0
? parsedJestRetries
: 1,
{ logErrorsBeforeRetry: true },
);

// http-proxy-middleware v4 is ESM-only and Jest's CJS module loader cannot
// load ESM packages. Auto-mock since no test exercises the proxy directly.
Expand Down
1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
"@chromatic-com/storybook": "^4.1.3",
"@eslint-react/eslint-plugin": "^3.0.0",
"@eslint/compat": "^2.0.0",
"@jedmao/location": "^3.0.0",
"@next/eslint-plugin-next": "^16.0.10",
"@playwright/test": "^1.57.0",
"@storybook/addon-docs": "^10.1.4",
Expand Down
23 changes: 19 additions & 4 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,25 @@ export default defineConfig({
fullyParallel: true,
/* 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 : 1,
/* Use multiple workers on CI for faster execution */
workers: process.env.CI ? 2 : undefined,
/* Retry on CI only. Overridable via E2E_RETRIES (e.g. the nightly zero-retry
* flake hunt). Honours an explicit 0; an unset/blank/negative/non-integer
* value falls back to the default rather than silently coercing to 0. */
retries: (() => {
const raw = process.env.E2E_RETRIES;
const parsed = raw ? Number(raw) : NaN;
if (Number.isInteger(parsed) && parsed >= 0) return parsed;
return process.env.CI ? 2 : 1;
})(),
/* Use multiple workers on CI for faster execution. CI e2e shards run on
* 8-core runners (see .github/workflows/e2e-tests.yml), so 4 workers leave
* headroom for the app + ClickHouse + Mongo. Override with E2E_WORKERS
* (a positive integer); anything else falls back to the default. */
workers: (() => {
const raw = process.env.E2E_WORKERS;
const parsed = raw ? Number(raw) : NaN;
if (Number.isInteger(parsed) && parsed >= 1) return parsed;
return process.env.CI ? 4 : undefined;
})(),
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html'],
Expand Down
Loading
Loading