Repository navigation
feat(e2e): run the CLI on Bun 1.4.3 and newer, without Node.js - #1616
Conversation
Moves the loader project fixture to tests/helpers/typescript-project.ts so the Bun suite reuses it.
Bun sets process.connected to false without a channel, so the CLI took a missing parent for a dead one and interrupted its own run at once. process.send marks a process spawned with a channel.
npx needs Node.js; a Bun project may have none.
Bun compiles the project's TypeScript itself, so e2e registers no module hooks there. What Bun lacks is a fresh instance: it drops the import query e2e keys instances by, so a re-imported test file registered no tests. config/bun-loader.ts deletes the module from Bun's registry (require.cache holds ES modules too) before loading it again, follows a fresh graph's project imports with Bun.Transpiler.scanImports and Bun.resolveSync, runs one load at a time, and evaluates with require() so a config's top level keeps its load's async context; top-level await finishes under import(). - internal/runtime.ts (was node-version.ts): Bun floor 1.4.3; 1.4.2 races require() of an ES module in a graph waiting on top-level await - registry: read JavaScriptCore frames without a column, skip `native` - diagnose: Bun BuildMessage positions, # import and missing export hints - doctor and report name Bun; telemetry shares runtimeOf - tests/integration/bun-runtime.test.ts runs the built CLI on Bun with no node on PATH; spec.yml runs it on Bun 1.4.3 and latest
From the GPT 6 Astra review of the Bun branch, each reproduced on Bun 1.4.3 and 1.4.4: - Bun's console wrote past the patched process.stdout, so console.log printed secrets verbatim and broke --reporter json. bun-loader now points console at the redacted streams before any project module runs. - Bun runs an imported module's top level outside its importer's async context, require() included once a dependency awaits. e2e/runner keeps runs apart by that context, so it refuses Bun (NODE_UNSUPPORTED), and e2e mcp holds one session on Bun. With nothing context-bound left, loads use plain import(): require-first and its fallback go. - One module instance per file means one live graph: a single current graph replaces the per-name map. - Alias classification asks Bun to resolve each tsconfig candidate; the stem heuristic missed dotted names (@lib/value.config) and left them stale. Queried imports keep their query in the module id only. - An explicit E2E_BUN runs the support tests on any Bun, so a moved floor fails CI; a fixture now pins the 1.4.2 require() race.
The Deno and missing-registerHooks branches protect no Node.js or Bun case: Bun returns before them, and every supported Node.js has the hooks. runtimeOf had two callers left, so doctor and report name the runtime inline, and telemetry keeps the detection it had before this branch.
serverEntry had one caller, and cli-init.test.ts already checks the bunx entry. The changeset, CI intro, and setup skill now say what users need and link the Bun limitations.
…fusing Deno - Bun loader scans .js files as JSX, as Bun runs them, and reloads data files (.toml, .txt, ...); computed-path imports documented as read once - keep main's Deno refusal (#790), now naming Bun - Bun MCP test opens a second session and gets the slot error - docs, skill, --max-sessions help, AGENTS.md: bunx registration, one session on Bun, bun CI job
🟢 e2e web: 91 passedAll 91 tests in 41 files
Tested by e2e 0.23.0 · 1m 23s · web · run artifacts |
🟢 e2e web agent: 33 passed34 agent steps · 26 replayed from cache · 20 model calls · 87.8k tokens (85% cached) · $0.0054 All 33 tests in 5 files
Tested by e2e 0.23.0 · 1m 40s · web · run artifacts |
There was a problem hiding this comment.
All reported issues were addressed across 39 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
… bunx in the MCP skill
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 60 model calls · 392.3k tokens (83% cached) · $0.0257 All 22 tests in 1 file
Tested by e2e 0.23.0 · 8m 18s · ios-simulator · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 39 model calls · 212.4k tokens (80% cached) · $0.0156 All 20 tests in 1 file
Tested by e2e 0.23.0 · 5m 22s · android-emulator · run artifacts |
🟢 e2e android: 1 flaky, 56 passed, 1 skipped
|
| Test | Time | |
|---|---|---|
| tests/controls.e2e.ts · 1 flaky, 23 passed, 1 skipped | 2m 47s | |
| control inventory › a label query resolves a labeled text field (1 failed attempt first) | 7.7s | |
| 🟢 | control inventory › a labeled field answers name, display value, value reads, fill, and clear | 15.0s |
| 🟢 | control inventory › a placeholder query and attribute reads find the field | 10.5s |
| 🟢 | control inventory › a secure field takes a fill and denies value reads | 8.5s |
| 🟢 | control inventory › press sends a character and Enter through the soft keyboard | 8.9s |
| 🟢 | control inventory › a field autofocuses on mount and focus() moves the focus | 9.1s |
| 🟢 | control inventory › toBeFocused follows the focus | 9.1s |
| 🟢 | control inventory › a switch checks, unchecks, and reports its state | 9.1s |
| 🟢 | control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap | 7.1s |
| 🟢 | control inventory › checkbox and radio roles check, uncheck, and report their state | 10.5s |
| 🟢 | control inventory › a tab role answers getByRole | 4.2s |
| 🟢 | control inventory › a radio group reports the checked option | 7.7s |
| 🟢 | control inventory › buttons report disabled, enabled, and a state that arrives later | 6.8s |
| 🟢 | control inventory › a display: none element is absent rather than hidden, its visible twin attached | 6.9s |
| 🟢 | control inventory › a header answers its accessible name | 4.0s |
| 🟢 | control inventory › a tab row answers count, all, texts, filters, positions, and switching | 5.6s |
| 🟢 | control inventory › a list answers counts, list-form text, reads, and boxes in order | 5.6s |
| ⏭️ | control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…) | |
| 🟢 | control inventory › a long press lands as one | 7.2s |
| 🟢 | control inventory › a double tap lands inside the 300 ms window | 6.6s |
| 🟢 | control inventory › an ambiguous locator fails at once | 5.2s |
| 🟢 | control inventory › screenshot, restart, and clearState reopen the app on its home list | 8.7s |
| 🟢 | refusals › verbs a device never declares are refused before the engine | 6ms |
| 🟢 | refusals › keys the soft keyboard cannot send are refused by the engine | 1.6s |
| 🟢 | refusals › a missing locator fails as not found once its timeout passes | 1.1s |
| 🟢 | tests/device-fixture.e2e.ts · 10 passed | 1m 23s |
| 🟢 | device fixture › setOrientation rotates the window the app measures | 5.0s |
| 🟢 | device fixture › home leaves the app, openApp brings it back where it was | 5.1s |
| 🟢 | device fixture › foregroundApp sees the home screen after home() | 3.9s |
| 🟢 | device fixture › closeApp then openApp relaunches on the home list | 7.6s |
| 🟢 | device fixture › closeApp leaves the next commands on the same device | 7.0s |
| 🟢 | device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN | 4.6s |
| 🟢 | device fixture › device.back pops the scenario | 4.8s |
| 🟢 | device fixture › unstable_raw reaches the test session through agent-device | 3.9s |
| 🟢 | device fixture › setNetwork and setAirplaneMode change what the app sees | 16.0s |
| 🟢 | device fixture › setLocation and clearLocation change what the app reads | 25.4s |
| 🟢 | tests/device.e2e.ts · 5 passed | 49.5s |
| 🟢 | permission prompt › allowing the system dialog enables the microphone | 6.9s |
| 🟢 | permission prompt › a denied prompt recovers once the permission is granted outside | 15.0s |
| 🟢 | sequential onboarding echoes the exact values | 11.2s |
| 🟢 | onboarding rejects a malformed email before advancing | 7.1s |
| 🟢 | dismissing the keyboard over choice controls leaves them as they were | 9.4s |
| 🟢 | tests/flows-lists.e2e.ts · 7 passed | 2m 26s |
| 🟢 | infinite scroll reaches the target item | 22.3s |
| 🟢 | product catalog adds exactly two of the right variant | 10.5s |
| 🟢 | gestures: long-press, then swipe left | 8.5s |
| 🟢 | gestures: double-tap completes the flow | 10.1s |
| 🟢 | sticky chrome: accept below the fold, then continue | 11.1s |
| 🟢 | async states: load, pull to refresh, claim through the toast | 12.4s |
| 🟢 | huge virtualized list reaches row 512 | 1m 11s |
| 🟢 | tests/flows.e2e.ts · 7 passed | 56.3s |
| 🟢 | text inputs unlock the submit button | 8.0s |
| 🟢 | filled text inputs report their values | 6.3s |
| 🟢 | modal flow confirms through the native alert | 10.0s |
| 🟢 | bottom tabs act inside the last tab | 7.4s |
| 🟢 | error recovery retries, then confirms the delete | 9.1s |
| 🟢 | choice controls place the exact order | 6.5s |
| 🟢 | debounced search selects the target once results arrive | 9.1s |
| 🟢 | tests/login-form.e2e.ts · 3 passed | 28.0s |
| 🟢 | login form › rejects a malformed email | 7.7s |
| 🟢 | login form › rejects an unknown account | 7.7s |
| 🟢 | login form › signs in and logs out | 12.5s |
| 🟢 | tests/smoke.e2e.ts · 1 passed | 6.0s |
| 🟢 | home lists the scenarios and opens one | 6.0s |
Tested by e2e 0.23.0 · 9m 29s · android-emulator · run artifacts
🟢 e2e ios: 55 passed, 1 skippedAll 56 tests in 7 files
Tested by e2e 0.23.0 · 5m 54s · ios-simulator · run artifacts |
|
[claude-opus-5-5] responding on behalf of okwasniewski Everything is green except Two flaky tests failed once here and passed on rerun. Neither is touched by this PR:
|
The e2e CLI runs on Bun 1.4.3 or newer with no Node.js installed:
bunx --bun e2e run. Node.js behavior does not change.What changed
module.registerHooks, which Bun lacks (oven-sh/bun#35690 is a draft). On Bun, e2e registers no hooks. Bun compiles TypeScript and resolves tsconfigpathsand#imports itself (config/bun-loader.ts).require.cache, which holds ES modules too, and imports it again. A fresh graph also reloads every project file the entry imports by path,#import, or tsconfig alias.Bun.Transpiler.scanImportsandBun.resolveSyncfind those files.consolewrites past theprocess.stdout.writethat e2e patches to redact secrets and route output. The loader pointsconsoleat the streams before any project code runs.e2e/runnerthrowsNODE_UNSUPPORTED. It already did, because of the missing hooks.e2e mcpopens one session at a time.require()of an ES module whose graph waits on top-level await. Deno is still refused.process.connectedonly when there is an IPC channel (cli/signals.ts).collect/registry.ts).config/diagnose.ts).e2e initregisters the MCP server withbunx.bunjob runstests/integration/bun-runtime.test.tson Bun 1.4.3 and on the latest Bun. The CLI, and everything it spawns, gets a PATH with nonodeon it.flowchart LR L[load a config or test file] --> R{runtime} R -- Node.js --> N["registerHooks + oxc<br/>an instance per ?e2e-graph= query"] R -- Bun --> B["Bun compiles it<br/>delete from require.cache, import again"]CLI reference, Bun lists what still differs on Bun:
#imports that map to a directory..ctsfiles.tsconfig.jsonand computed-path imports one time.executable: 'node'underbun <file>.await.The mobile engine and the integrations are not verified on Bun yet.
Verified
Ran it locally: yes
Released e2e vs this branch:
e2e --versionon Bun 1.4.4, with only Bun and git on PATH.e2e runs on Node.js: Bun 1.4.4 reports Node.js 26.3.0 but has no module.registerHooks, which e2e's TypeScript loader needs.(exit 2)0.23.0. Thene2e doctoron the testbed prints✓ node Bun 1.4.4 (>=1.4.3)ande2e run can start hereTestbed on Bun: the built CLI on Bun 1.4.4, run with
env -i PATH=<bun and git>:/usr/bin:/bin bun run e2e run. Same totals as on Node.js 24.19:e2e mcp --max-sessions 3on Bun: it logs that the flag is ignored. A secondopen_sessiongetsno session slot is free (e2e mcp --max-sessions 1).Reverting fixes: each Bun test added for a loader or MCP fix fails with its fix reverted. That covers reloading a JSX
.jsfile and a data file in a fresh graph, query imports, dotted aliases, console redaction, and the one-session cap.