From fc718571e003ec049b7f0a535759c75870b12f71 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 1 Sep 2026 19:33:01 +0100 Subject: [PATCH 1/3] test(e2e): stabilize playground smoke --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++++---- e2e/playground/playwright.config.ts | 4 +-- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 595fcaeccd..358ed261e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,13 +230,15 @@ jobs: test-e2e-rollup: name: E2E Tests if: always() - needs: [test-e2e] + needs: [test-e2e, test-e2e-cloudflare, test-e2e-playground] runs-on: ubuntu-latest timeout-minutes: 5 steps: - - name: Check E2E shard results + - name: Check E2E results run: | - if [ "${{ needs.test-e2e.result }}" != "success" ]; then + if [ "${{ needs.test-e2e.result }}" != "success" ] || + [ "${{ needs.test-e2e-cloudflare.result }}" != "success" ] || + [ "${{ needs.test-e2e-playground.result }}" != "success" ]; then echo "E2E tests failed or were cancelled" exit 1 fi @@ -278,6 +280,38 @@ jobs: test-results/ retention-days: 7 + test-e2e-playground: + name: Playground E2E + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm run --filter "@emdash-cms/playground^..." build + - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ hashFiles('pnpm-lock.yaml') }} + - run: pnpm exec playwright install --with-deps chromium + if: steps.playwright-cache.outputs.cache-hit != 'true' + - run: pnpm run test:e2e:playground + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: failure() + with: + name: playwright-report-playground + path: | + playwright-report/ + test-results/ + retention-days: 7 + test-e2e-cloudflare: name: E2E Cloudflare (${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) runs-on: ubuntu-latest @@ -311,8 +345,6 @@ jobs: - run: pnpm exec playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} env: EMDASH_E2E_TARGET: cloudflare - - run: pnpm run test:e2e:playground - if: matrix.shardIndex == 1 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: failure() with: diff --git a/e2e/playground/playwright.config.ts b/e2e/playground/playwright.config.ts index 66df606faf..071fc2e363 100644 --- a/e2e/playground/playwright.config.ts +++ b/e2e/playground/playwright.config.ts @@ -5,10 +5,10 @@ export default defineConfig({ testMatch: "media-ready.spec.ts", fullyParallel: false, workers: 1, - timeout: 120_000, + timeout: 240_000, use: { baseURL: "http://localhost:4450", - trace: "on-first-retry", + trace: "retain-on-failure", screenshot: "only-on-failure", ...devices["Desktop Chrome"], }, From 0cd593548e67435547dfa9bdc29e8b6da305d8f7 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 2 Sep 2026 10:53:01 +0100 Subject: [PATCH 2/3] test(e2e): tolerate slow playground initialization --- .github/workflows/ci.yml | 4 +--- e2e/playground/media-ready.spec.ts | 2 +- e2e/playground/playwright.config.ts | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 358ed261e7..0b4d47b827 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,9 +307,7 @@ jobs: if: failure() with: name: playwright-report-playground - path: | - playwright-report/ - test-results/ + path: test-results/ retention-days: 7 test-e2e-cloudflare: diff --git a/e2e/playground/media-ready.spec.ts b/e2e/playground/media-ready.spec.ts index d2a5877481..043803e445 100644 --- a/e2e/playground/media-ready.spec.ts +++ b/e2e/playground/media-ready.spec.ts @@ -18,7 +18,7 @@ async function openFreshPlayground(page: Page): Promise { dialog.getByRole("button", { name: "Get Started" }).click(), ); await page.goto("/playground"); - await page.waitForURL(ADMIN_URL_PATTERN, { timeout: 120_000 }); + await page.waitForURL(ADMIN_URL_PATTERN, { timeout: 240_000 }); await expect(page.getByRole("link", { name: "Media", exact: true })).toBeVisible({ timeout: 60_000, }); diff --git a/e2e/playground/playwright.config.ts b/e2e/playground/playwright.config.ts index 071fc2e363..6faa488999 100644 --- a/e2e/playground/playwright.config.ts +++ b/e2e/playground/playwright.config.ts @@ -5,7 +5,8 @@ export default defineConfig({ testMatch: "media-ready.spec.ts", fullyParallel: false, workers: 1, - timeout: 240_000, + retries: process.env.CI ? 1 : 0, + timeout: 360_000, use: { baseURL: "http://localhost:4450", trace: "retain-on-failure", From dcbb6def9eec44ffb1513f9756aa13a43ab2faa1 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 2 Sep 2026 12:36:17 +0100 Subject: [PATCH 3/3] test(e2e): wait for playground data loads --- e2e/playground/playwright.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/playground/playwright.config.ts b/e2e/playground/playwright.config.ts index 6faa488999..93f9b54c9a 100644 --- a/e2e/playground/playwright.config.ts +++ b/e2e/playground/playwright.config.ts @@ -1,12 +1,16 @@ +import { fileURLToPath } from "node:url"; + import { defineConfig, devices } from "@playwright/test"; export default defineConfig({ testDir: ".", testMatch: "media-ready.spec.ts", + outputDir: fileURLToPath(new URL("../../test-results", import.meta.url)), fullyParallel: false, workers: 1, retries: process.env.CI ? 1 : 0, timeout: 360_000, + expect: { timeout: 60_000 }, use: { baseURL: "http://localhost:4450", trace: "retain-on-failure",