test(e2e): integration suites on the fake engine, cut to what only integration proves

Merged
OK
2mo ago
+1269-3966

The packages/e2e integration suite, trimmed to what only an integration run proves. Suites that don't read a page run on the fake engine, and fixed sleeps become event-driven waits. Test-only.

  • Fake engine: runner lifecycle, run events, parallel workers, reporters, expect.poll scope, expect.soft, extended fixtures, and runProject without an app URL. A browser starts only where a page is read.
  • Folded: mcp-custom into mcp-server (one server), the class and URL-pattern suites into web-platform's config-file run, the stale --strict-cache run into the changed-screen suite, semantic fallback into agent-fallback-handoff, and serial artifact checks into artifact-store-serial.
  • Dropped: integration cases that unit tests or the testbed already pin (each checked for a surviving test before the cut), the trace-cache-speed wall-clock gate (its replay check lives in trace-cache-replay), and line-by-line prose checks.
  • Stronger: secret suites now read the model input and inflated trace.zip entries, not just the run result, and fail their deliberate tap in 500 ms instead of the 30 s action timeout. Project tool results and errors in MCP go through the secret ledger. engine-target asserts UNSUPPORTED_CAPABILITY and its category, not a message regex.
  • New: Ctrl-C releases what prepare acquired, plus exit 3, --shard, and CI defaults through the CLI, and a timeout on the worker path.
  • engine-contract.test.ts is also edited by #813 (oskar/fix-serial-verdicts). Whichever lands second needs a trivial rebase. Merged together, both are green.

Verified

Ran it locally: yes (full packages/e2e integration suite, --maxWorkers=3, on a shared machine)

e2e integrationmainthis PR
tests622535
wall time240 s111 s (132 s on a loaded run)

Mutation checks on the moved and rewritten tests. Each mutation was made in src, rebuilt into dist, run against the one test file, then reverted.

mutationcaught by
absent-frame reads poll to the deadline before returning no match (src/locator/engine.ts)web-platform absent-frame duration (< 3 s)
abandonRunning marks the step passed, or returns no error (src/run/steps.ts)both STEP_NOT_AWAITED step tests in expect-poll-scope
a read on a detached node reports hidden (packages/web/src/read-selector.ts)web-replaced-nodes, normal and starved; the 3-read starved case caught it 3/3
wait drops the timeout remap, or checkStepClock ignores the deadlineengine-contract step timeout
missing capability thrown as a test error, not a configuration errorengine-target capability code
store-path artifact size 0, digest not hex, path moved (src/run/artifacts.ts)artifact-store-serial
pixelFallback ignores taint (act or judgment), or ignores vision: falseagent-fallback-handoff tainted and tree-only judgments
visionInput dropped from the step recordagent-fallback-handoff
toolAppliesTo ignores platforms; an undeclared verb reads as UNKNOWN_TOOLmcp-server kiosk tools
act.ts concludes a no-model hand-off as failed (regression of #710)agent-trace-cache "keeps an entry whose replay handed off to a model that never answered"
a test without a session restores another test's sessionparallel-workers "without a session starts clean"
explorerAgent drops the model a custom executor broughtexplore executor replacement case
token counters accept fractions (isSafeInteger to isFinite)model-usage 0.5 row
a --trace off / --video off flag reads as unsetunit config.test.ts flag override

The last five were cut first and then restored after self-review or bot review, because nothing else covered them. Fake-engine runs no longer inherit the caller's APP_URL. The MCP session TTL and idle polls also got a 5 s timeout: with a 500 ms TTL, the default 1 s poll left too little slack on a loaded runner.