Skip to content

fix(e2e): make the CI Playwright run coherent (serve every spec's demo)#153

Merged
zzal merged 2 commits into
mainfrom
fix/ci-e2e-infra
Jul 6, 2026
Merged

fix(e2e): make the CI Playwright run coherent (serve every spec's demo)#153
zzal merged 2 commits into
mainfrom
fix/ci-e2e-infra

Conversation

@zzal

@zzal zzal commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

The CI playwright-e2e job ran the default config, which has no testMatch — so it runs all 11 specs — but starts only 4 servers (counter :3000, router :3001, sw :3002, edgecases :3003). It never served SwiflowUIDemo (datatable/dropdown), RegionDemo (region), or the TodoCRUD backend, so those 16 specs failed "element not found." The gap was masked for ages by the MiniRouter config-load abort (fixed in #152); once that cleared, the whole run finally reached these specs and they went red.

Fix (scope the default config + run the dedicated configs)

The dedicated per-demo configs collide on port :3004 (RegionDemo vs SwiflowUIDemo) by design — they're meant to run separately. So:

  • Default config testIgnores the 4 orphan spec groups (region, datatable, dropdown, todocrud) — it keeps its fast 4-server parallel run for the specs those serve.
  • CI e2e step runs three configs: npm test (default) → npm run test:regionsnpm run test:swiflowui, sequentially, accumulating exit status so one red spec doesn't hide the others. TodoCRUD stays in the existing separate run-e2e-backend job (it needs the real Bun+SQLite backend).
  • Added the missing test:swiflowui npm script — the playwright.swiflowui.config.ts existed but was never scripted, so datatable/dropdown had never actually run against their server.

A latent bug this surfaced

Because datatable/dropdown had never run against SwiflowUIDemo, a real bug was hiding: datatable.spec.ts's pager test used an unscoped getByRole("button", { name: "Next" }), which also matches the demo's wizard Button("Next"). Scoped it to the paged table's own .sw-table__pager.

Test plan

  • test:swiflowui 10/10 locally (datatable + dropdown, including the fixed pager test).
  • test:regions 1/1 locally (region against RegionDemo).
  • The default config's served specs are the 40 that already passed in CI before; testIgnore only removes the 4 it couldn't serve. TodoCRUD unaffected (separate job).
  • Triggering run-e2e on this PR to confirm the full pipeline goes green.

🤖 Generated with Claude Code

The CI `playwright-e2e` job ran the default config, which has no testMatch and so
runs ALL specs — but starts only 4 servers (counter/router/sw/edgecases). It
never served SwiflowUIDemo (datatable/dropdown), RegionDemo (region), or the
TodoCRUD backend, so those 16 specs failed "element not found." This was masked
for ages by the MiniRouter config-load abort (fixed in #152); once that cleared,
the gap surfaced.

- Default config `testIgnore`s the 4 orphan spec groups — they collide on port
  :3004 (RegionDemo vs SwiflowUIDemo) so can't share the default config's
  parallel servers, and todocrud needs the real Bun+SQLite backend.
- CI e2e step now runs three configs: `npm test` (default) then `test:regions`
  and `test:swiflowui`, sequentially, accumulating status so one red doesn't hide
  the rest. TodoCRUD stays in the separate run-e2e-backend job.
- Added the missing `test:swiflowui` npm script (the swiflowui config existed but
  was never scripted, so datatable/dropdown had NEVER run against their server).
- Fixed the latent bug that surfaced: `datatable.spec.ts` pager test used an
  unscoped getByRole("button", {name:"Next"}) that also matched the demo's wizard
  "Next" button — scoped it to `.sw-table__pager`.

Verified locally: test:swiflowui 10/10, test:regions 1/1. The default config's
served specs are the 40 that already passed in CI; todocrud unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zzal zzal added the run-e2e Run the (expensive) Playwright e2e job on this PR label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

📦 Bundle size

Artifact Baseline This PR Δ
App.wasm 5.06 MB 5.15 MB +1.91%
App.wasm (gzip) 1.80 MB 1.84 MB +2.20%
JS runtime 54.5 KB 54.5 KB +0.00%
JS runtime (gzip) 11.3 KB 11.3 KB +0.00%
Total (gzip) 1.81 MB 1.85 MB +2.19%

✅ Within budget (≤5% growth allowed).

Baseline: Swift 6.3, WASM SDK 6.3-RELEASE, measured 2026-06-18.

…t clash

CI run: default 40 passed, regions 1 passed, then swiflowui failed to start with
"port 3004 already in use". regions.config (RegionDemo) and swiflowui.config
(SwiflowUIDemo) both bound :3004; run back-to-back in the same CI step, the
regions `swiflow dev` server hadn't released :3004 before swiflowui tried to bind
it (local teardown is fast enough to hide this; CI's isn't). Give SwiflowUIDemo
its own port :3005 (datatable/dropdown use the config baseURL, so no spec change).

Verified: test:swiflowui 10/10 on :3005.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zzal zzal merged commit 1d86785 into main Jul 6, 2026
6 checks passed
@zzal zzal deleted the fix/ci-e2e-infra branch July 6, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Run the (expensive) Playwright e2e job on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant