Repository navigation
test runtime: Node-only build script tests run on Node (orca #48, slice 8) - #58
Merged
nachumi-a2zoperations merged 1 commit intoNov 15, 2026
Conversation
…ce 8)
Two config scripts that production runs on Node had their tests on Bun,
where Bun behaves differently (each proven by a probe outside Orca, on
the MacBook with bun 1.4.4):
- reclaim-worktree-generated-files: on a read-only directory with files
in it, Node's fs.rm throws EACCES and Bun's throws ENOTEMPTY. The
script makes the tree writable and retries only on EACCES/EPERM, so
under Bun the retry never ran ("Some generated directories could not
be removed"). Production: `pnpm reclaim-space` = node
reclaim-worktree-space.mjs, which spawns this script with
process.execPath.
- macos-terminal-host-bundle: after a first require.resolve(..., {paths:
[dir]}) from a directory, Bun keeps that directory's state and misses
a node_modules created later, falling back to its global install
cache (~/.bun/install/cache/yaml@...); Node sees the new folder and
resolves inside the bundle. The test's second check depends on that.
Production: the .cjs helper is loaded by electron-builder.config.cjs
on Node.
Fix: route both tests to the Node runtime in
vitest-node-runtime-files.mjs, with the reason beside them. No product
code changes.
Test: the routing test gets a slice 8 case; red first (both on Bun),
green now. The routing test + both files through the normal runner:
26/26 (2 were red).
Refs #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #48 (slice 8: two Node-only build scripts whose tests ran on Bun; 2 red files). #48 stays open for the rest.
Root cause
Production runs both scripts on Node, but their tests ran on Bun, which behaves differently. Each difference was proven by a probe outside Orca (MacBook, bun 1.4.4 vs Node):
config/scripts/worktree-storage/reclaim-worktree-generated-files.test.mjsfs.rmon a read-only directory with files in it throwsENOTEMPTY; Node throwsEACCESEACCES/EPERM, so under Bun the retry never ran ("Some generated directories could not be removed")pnpm reclaim-space=node reclaim-worktree-space.mjs, which spawns it withprocess.execPathconfig/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.test.mjsrequire.resolve(…, { paths: [dir] })from a directory, Bun keeps that directory's state and misses anode_modulescreated later, falling back to its global install cache (~/.bun/install/cache/yaml@…).cjshelper is loaded byelectron-builder.config.cjson NodeFix
Route both tests to the Node runtime in
vitest-node-runtime-files.mjs, with the proven reason beside them. Product code is unchanged.Tests
check-changed: 13/13.