Skip to content

fix(e2e): add smoke fail-fast project to abort on broken-infra runs - #13

Merged
mborgeson merged 1 commit into
mainfrom
fix/e2e-smoke-fail-fast
Apr 30, 2026
Merged

fix(e2e): add smoke fail-fast project to abort on broken-infra runs#13
mborgeson merged 1 commit into
mainfrom
fix/e2e-smoke-fail-fast

Conversation

@mborgeson

Copy link
Copy Markdown
Owner

Summary

Adds a one-shot smoke Playwright project that runs before every other project. When it fails, Playwright skips dependents and the suite exits in <2 minutes instead of running ~40 minutes of redundant red across 400+ tests.

What it does

The smoke test (e2e/smoke.spec.ts) validates the most fundamental contract in a single navigation:

  1. page.goto('/') redirects an unauthenticated user to /login — proves dev server is reachable, Vite served the bundle, router booted, and the auth gate ran.
  2. getByLabel(/email/i) is visible on /login — proves React actually rendered (no white-screen hydration crash).

Wire-up in playwright.config.ts:

  • New smoke project: testMatch: /smoke\.spec\.ts/, retries: 0.
  • chromium and ci gain dependencies: ['smoke'] and testIgnore: /smoke\.spec\.ts/ so the smoke spec runs exactly once, before everything else.

Why standalone (no auth dependency)

The smoke test deliberately does NOT depend on auth, storageState, or any backend behavior beyond the login page being reachable. This is the right scope for a fail-fast check:

  • A broken auth fixture should NOT mask a healthy app and abort the suite.
  • A broken app should NOT be obscured by an auth setup race.
  • The check has to run before auth even has a chance to matter.

Composition with PR #12 (auth fixture setup)

PR #12 introduces a setup project that authenticates and persists storageState to e2e/.auth/admin.json. Both can coexist cleanly: when PR #12 lands, chromium and ci simply list dependencies: ['smoke', 'setup']. The smoke project gates everything; the setup project warms credentials only for tests that need them. Order between them is unimportant because smoke does not consume storageState.

This PR is branched from origin/main, so the conflict surface with PR #12 is just the dependencies array on chromium and ci. Trivial to resolve in whichever PR lands second.

Expected impact

Scenario Before After
Dev server down, build broken, router wedged ~40 min of red across all 400+ tests <2 min, suite aborts after smoke
Healthy infrastructure smoke + 404 tests smoke + 404 tests (negligible overhead)

Test plan

  • npx tsc --noEmit playwright.config.ts e2e/smoke.spec.ts — clean
  • npx playwright test --list --project=smoke — 1 test
  • npx playwright test --list --project=chromium — 404 tests (smoke excluded; was 405 before testIgnore)
  • CI run: confirm smoke runs first, chromium/ci wait on it
  • Negative validation: temporarily break baseURL, confirm chromium/ci are skipped (do NOT merge with this in place)

🤖 Generated with Claude Code

Add a one-shot smoke project that runs before every other Playwright
project. It validates the most fundamental contract — dev server up,
React app served, router redirects unauthenticated users to /login —
in a single navigation. When it fails, Playwright skips downstream
projects via the new dependencies wiring, so the suite exits in <2 min
instead of running ~40 min of redundant red across 400+ tests.

The smoke test is intentionally standalone: no auth, no storageState,
no backend dependency beyond the login page being reachable. This lets
it compose cleanly with the auth setup project that PR #12 introduces;
chromium and ci can list both as dependencies in any order without
coupling smoke to credential availability.

- e2e/smoke.spec.ts: single test, asserts /login redirect and email
  field visible (proves React rendered, not a hydration crash)
- playwright.config.ts: new "smoke" project (testMatch on smoke spec,
  retries: 0). chromium and ci gain dependencies: ['smoke'] and
  testIgnore on smoke.spec.ts so the smoke test only runs once.

Verified: tsc --noEmit clean; playwright test --list shows 1 smoke
test under the smoke project and 404 tests under chromium (smoke
excluded as expected).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mborgeson
mborgeson force-pushed the fix/e2e-smoke-fail-fast branch from f4e6205 to e02631f Compare April 30, 2026 10:31
@mborgeson
mborgeson merged commit 0ce867c into main Apr 30, 2026
1 check failed
@mborgeson
mborgeson deleted the fix/e2e-smoke-fail-fast branch April 30, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant