Skip to content

CI: fast test accounts, six e2e shards, unit suites in parallel - #409

Closed
baronunread wants to merge 1 commit into
dev-scenariosfrom
ci-speed
Closed

baronunread wants to merge 1 commit into
dev-scenariosfrom
ci-speed

Conversation

@baronunread

@baronunread baronunread commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #408 (it reuses the dev-only /__dev mount). Merge #408 first; this PR's base then moves to main.

Why

A PR waited 7 to 10 minutes for CI. In recent runs:

Job Time
e2e shard 1 7 to 10 min (the bottleneck)
e2e shard 2 5 to 6 min
e2e shard 3 about 3.5 min
unit (three suites, one after another) 3 to 5 min

Most browser tests started by making an account through the real sign-up form: Turnstile, an account write, a mail send, then the code read back out of the emulator. Timed at 5.8 to 7.2 s each. 35 of the 49 spec files call it, 73 times in all.

What

  • Fast test accounts. POST /__dev/test-account (in src/worker/dev-scenarios.ts, dev builds only, the same fence as Dev scenarios: every account state one link away #408) makes a verified account through BetterAuth's own adapter, so the user create hooks still run (the superadmin pin, the welcome mail). It then signs in through auth.api.signInEmail, so the session hook creates the org exactly as it does for a person. It refuses an address that already exists, so it can't be used to sign in as anybody.
  • signUpAndVerify (tests/e2e/resend.ts) now uses that route and lands on the dashboard, the same end state as before.
  • signUpThroughForm keeps the real flow for the specs that are about it: auth, first-run, anon-shortener (it claims an anonymous link during sign-up) and google-signin.
  • Six e2e shards instead of three. The repo is public, so the extra runners are free.
  • unit becomes a matrix of test, test:worker and test:worker:self-host, run in parallel. No required checks name the old jobs (checked the Main ruleset).

Measured

  • Locally, full chromium suite, same machine: main took 10.5 min (197 passed); this branch takes 7.6 min (198 passed: the extra one is the dev-scenarios spec from Dev scenarios: every account state one link away #408). That's 28% less time, below my 40 to 50% estimate: the other costs (page loads, link writes, the dev server) are a bigger share than I thought.
  • CI gets that plus six shards. Expected wall time is about 3 to 4 minutes; this PR's own run will show the real number.

What changes in coverage

Fewer tests go through the real sign-up form. The four specs above still do, so a sign-up regression still fails CI.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7995b9d and 942556d.

Files selected for processing: 9
  • .github/workflows/test.yml
  • src/worker/dev-scenarios.ts
  • tests/e2e/anon-shortener.pw.ts
  • tests/e2e/auth.pw.ts
  • tests/e2e/downgrade.pw.ts
  • tests/e2e/first-run.pw.ts
  • tests/e2e/google-signin.pw.ts
  • tests/e2e/production/status-codes.pw.ts
  • tests/e2e/resend.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 942556d.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Observability score · 100

excellent · unchanged against dev-scenarios · no regression

104 instrumented · 1 partial · 0 dark

Fix first (1)

evlog map v0.9.0 · how the score works · what each check expects

@github-actions

Copy link
Copy Markdown

leanest: 57 of 57 playwright test files selected

All 57 run because the runner setup changed (.github/workflows/test.yml).

57 test files
Test Decision Reason
tests/e2e/abuse-hold.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/abuse.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/account-deletion.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/admin-moderation.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/admin-triage.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/analytics-export.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/anon-link-bar.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/anon-shortener.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/api-keys.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/api-method.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/auth.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/authenticated-flows.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/avatar.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/billing-page.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/billing-truth.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/billing-yearly.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/click-buffer.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/click-caps.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/command-menu.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/default-domain.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/dev-scenarios.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/downgrade.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/first-run.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/funnel.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/google-signin.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/graphical-ui.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/header-float.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/hero-globe.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/invites.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/landing-sections.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/link-addresses.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/link-import.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/link-risk.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/link-states.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/links-paging.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/mcp-oauth.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/new-link-live.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/not-found.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/page-ending.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/pricing-page.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/privacy-and-email-abuse.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/production/assets.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/production/csp.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/production/prerendered-pages.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/production/seo.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/production/status-codes.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/public-pages.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/qr-download.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/qr-generator.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/route-skeletons.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/self-host/no-providers.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/self-host/self-host.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/shell-persistence.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/turnstile-slot.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/utm-builder.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/viewer-role.pw.ts RUN runner setup changed (.github/workflows/test.yml)
tests/e2e/webmcp.pw.ts RUN runner setup changed (.github/workflows/test.yml)

@baronunread

Copy link
Copy Markdown
Owner Author

Cold review fixes, in f92b72c (rebased on #408's fixes):

  • /__dev/test-account moved into handleDev, so it carries a wide event.
  • It refuses SUPERADMIN_EMAIL, even before that account exists. A dev server is reachable on the network.
  • The production check now also expects no answer and no session from POST /__dev/test-account.
  • downgrade.pw.ts polls for the invite row instead of reading it straight after the click; it flaked on this PR's shard 2.

The review confirmed the fast account matches a real sign-up (superadmin pin, verified email, name, org via the session hook, welcome email). The specs that need the real form still use it. The workflow matrix and shard args are correct.

Browser tests made every account through the sign-up form (Turnstile, an
account write, a mail send, a code read back from the emulator): 6 to 7
seconds each, in 35 of 49 spec files. POST /__dev/test-account (dev builds
only, in handleDev next to the scenarios) makes a verified, signed-in
account in one request through BetterAuth's own adapter, so the same hooks
run and the session hook creates the org. It only creates new addresses,
and refuses SUPERADMIN_EMAIL.

signUpAndVerify now uses it. signUpThroughForm keeps the real flow for the
specs about it: auth, first-run, anon-shortener, google-signin.

CI also gets six e2e shards instead of three, and the three unit suites
run as parallel jobs. downgrade.pw.ts polls for the new invite row instead
of racing its write, and the production check covers the test-account
route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@baronunread
baronunread deleted the branch dev-scenarios October 27, 2026 15:03
baronunread added a commit that referenced this pull request Oct 27, 2026
Replaces #409, which GitHub closed when #408's branch was deleted on
merge. Same change, now on `main` as a single commit. #409's review
comments and fixes still apply.

## Why

A PR waited 7 to 10 minutes for CI. In recent runs:

| Job | Time |
|---|---|
| e2e shard 1 | 7 to 10 min (the bottleneck) |
| e2e shard 2 | 5 to 6 min |
| e2e shard 3 | about 3.5 min |
| unit (three suites, one after another) | 3 to 5 min |

Most browser tests started by making an account through the real sign-up
form: Turnstile, an account write, a mail send, then the code read back
out of the emulator. Timed at **5.8 to 7.2 s each**. 35 of the 49 spec
files call it, 73 times in all.

## What

- **Fast test accounts.** `POST /__dev/test-account` (in
`src/worker/dev-scenarios.ts`, dev builds only, the same fence as #408)
makes a verified account through BetterAuth's own adapter, so the user
`create` hooks still run (the superadmin pin, the welcome mail). It then
signs in through `auth.api.signInEmail`, so the session hook creates the
org exactly as it does for a person. It refuses an address that already
exists, so it can't be used to sign in as anybody.
- **`signUpAndVerify`** (`tests/e2e/resend.ts`) now uses that route and
lands on the dashboard, the same end state as before.
- **`signUpThroughForm`** keeps the real flow for the specs that are
about it: `auth`, `first-run`, `anon-shortener` (it claims an anonymous
link during sign-up) and `google-signin`.
- **Six e2e shards** instead of three. The repo is public, so the extra
runners are free.
- **`unit` becomes a matrix** of `test`, `test:worker` and
`test:worker:self-host`, run in parallel. No required checks name the
old jobs (checked the `Main` ruleset).

## Measured

- **Locally, full chromium suite, same machine:** `main` took **10.5
min** (197 passed); this branch takes **7.6 min** (198 passed: the extra
one is the dev-scenarios spec from #408). That's 28% less time, below my
40 to 50% estimate: the other costs (page loads, link writes, the dev
server) are a bigger share than I thought.
- **CI** gets that plus six shards. Expected wall time is about 3 to 4
minutes; this PR's own run will show the real number.

## What changes in coverage

Fewer tests go through the real sign-up form. The four specs above still
do, so a sign-up regression still fails CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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