Repository navigation
CI: fast test accounts, six e2e shards, unit suites in parallel - #409
baronunread wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Observability score · 100excellent · unchanged against 104 instrumented · 1 partial · 0 dark Fix first (1)
evlog map v0.9.0 · how the score works · what each check expects |
leanest: 57 of 57 playwright test files selectedAll 57 run because the runner setup changed (.github/workflows/test.yml). 57 test files
|
|
Cold review fixes, in f92b72c (rebased on #408's fixes):
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>
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>
Stacked on #408 (it reuses the dev-only
/__devmount). Merge #408 first; this PR's base then moves tomain.Why
A PR waited 7 to 10 minutes for CI. In recent runs:
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
POST /__dev/test-account(insrc/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 usercreatehooks still run (the superadmin pin, the welcome mail). It then signs in throughauth.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.signUpThroughFormkeeps the real flow for the specs that are about it:auth,first-run,anon-shortener(it claims an anonymous link during sign-up) andgoogle-signin.unitbecomes a matrix oftest,test:workerandtest:worker:self-host, run in parallel. No required checks name the old jobs (checked theMainruleset).Measured
maintook 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.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