Skip to content

fix(ci): e2e near 2 minutes via shared web build, consolidated browser boots, sharded jobs - #1098

Merged
TheGreatAxios merged 12 commits into
mainfrom
cl-9850-fixci-e2e-near-2-minutes-via-shared-web-build-consolidated
Oct 9, 2026
Merged

TheGreatAxios merged 12 commits into
mainfrom
cl-9850-fixci-e2e-near-2-minutes-via-shared-web-build-consolidated

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Cuts the ~8-minute e2e run three ways. Fewer, higher-quality suites: reply folds into zero-to-one's single flow (naming, Custom field count, rename finale; second signup deleted) and setup plus composer-layout fold into first-run.test.ts on one shared boot (seed-nothing test first; setup's helper copies deleted). 11 browser files to 8 with every unique assertion preserved.

Layers: (1) apps/web builds once per e2e process via a dist fingerprint (e2e/lib/web-build.ts, unit-tested); (2) the consolidation above, which also pulls boots back inside the documented per-process budget; (3) CI splits into a 3-shard browser matrix (round-robin, new files auto-join) plus a Chrome-less hub job.

Local gates green: typecheck, lint (0 errors), fmt, focused unit tests. Honest estimate is ~3.5 min wall clock, not 2 — the floor is deploy physics plus per-job overhead. True 2 min needs cutting a deploy cycle.

Linear: CL-9850.

@linear-code

linear-code Bot commented Oct 3, 2026

Copy link
Copy Markdown

CL-9850

@TheGreatAxios
TheGreatAxios marked this pull request as draft October 9, 2026 02:48
…-1 assertions

The web-build freshness fingerprint previously hashed HEAD plus worktree
status only, so a BASE_URL env flip produced a different dist under an
identical tree and isWebBuildFresh still reported true. Add a regression
test asserting freshness is false when the effective build config flips
under an unchanged tree, plus a guard that a non-serializable config is
rejected loudly.

Restoring the evaluation-journal assertion in zero-to-one (dropped when
reply.test.ts folded in): the worker reply must prove the scripted
inference provider was dialed. Also wait for the 'Start this workbench'
button's enabled state before clicking in zero-to-one, matching
runFirstRunFlow, to close the navigate-to-/w/ flake window.
…e in CI

webBuildFingerprint now hashes the build's effective configuration (via a
new buildConfig argument) alongside HEAD and worktree status, so a BASE_URL
env flip invalidates the marker and rebuilds the web bundle instead of
serving a stale dist. webBuildConfig() in the browser harness passes the
env the vite build reads; the freshness check, marker write, and compose
all share it.

Wire e2e/lib/web-build.test.ts into the CI e2e-hub job: it lives in
e2e/lib, which no browser/mcp shard glob and no workspace package test root
would otherwise run, so its fingerprint unit suite was dead in CI and in
the local gate.
The production dist never bakes an env: apps/web/vite.config.ts reads
BASE_URL only for the dev-server proxy, and apps/web/src has no
process.env / import.meta.env references. But e2e/lib/hub.ts sets
process.env.BASE_URL to each hub's port at boot and never restores it;
with every browser file in one 'bun test' process, a leaked BASE_URL must
not flip the fingerprint or the shared-build freshness gate would rebuild
apps/web per suite. Guard exactly that, capturing the fingerprint after
the marker exists so both sides of the comparison see the same tree.
webBuildConfig() stamped process.env.BASE_URL into the freshness
fingerprint, but that was doubly wrong: the production dist is
env-independent (BASE_URL only configures the dev-server proxy), and the
hub boot leaks the env (hub.ts:80) so subsequent browser suites in a CI
shard would hash a different BASE_URL than the stored marker and rebuild
apps/web each time — defeating the shared-build freshness gate. Remove the
build-config component entirely; the fingerprint is HEAD + worktree status
again, exactly as before this change.
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 9, 2026 05:13
@TheGreatAxios
TheGreatAxios merged commit 76b6737 into main Oct 9, 2026
6 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-9850-fixci-e2e-near-2-minutes-via-shared-web-build-consolidated branch October 9, 2026 05:13
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