Skip to content

fix(ci): upgrade @vscode/test-electron to fix macOS test failures - #1049

Merged
wenytang-ms merged 1 commit into
mainfrom
fix/test-electron-darwin-executable
Aug 3, 2026
Merged

fix(ci): upgrade @vscode/test-electron to fix macOS test failures#1049
wenytang-ms merged 1 commit into
mainfrom
fix/test-electron-darwin-executable

Conversation

@wenytang-ms

Copy link
Copy Markdown
Contributor

Problem

The macOS job fails on every run while Linux and Windows pass — see run 30778815599 (2026-08-03). It dies immediately after the VS Code download:

Test error: Error: spawn .../.vscode-test/vscode-darwin-arm64-1.131.0/Visual Studio Code.app/Contents/MacOS/Electron ENOENT
Error: Test run failed with code -2

Root cause

VS Code 1.110 renamed the macOS main binary inside the .app bundle from the historical Electron to the product name (Code), keeping a compatibility symlink under the old name. That symlink was removed in microsoft/vscode#326502, so any 1.110+ archive now fails to launch via the old path. The test runner does not pin a VS Code version, so it resolves the latest release (1.131.0) and hits this.

@vscode/test-electron ^2.5.2 hardcodes the old path in out/util.js:

return path.resolve(dir, 'Visual Studio Code.app/Contents/MacOS/Electron');

Only macOS goes through this code path, which is why the other platforms are unaffected. Upstream fixed it in microsoft/vscode-test#350, released in 3.1.0: the executable is resolved from CFBundleExecutable in Info.plist, falling back to the sole regular file in Contents/MacOS/ and finally to the legacy Electron name, so both the new and pre-1.110 layouts work. The fix landed after 3.0.0, so 3.1.0 is the earliest release that carries it — there is no 2.x backport.

Changes

Bump @vscode/test-electron ^2.5.2^3.1.0. package.json and the lockfile only.

Beyond @vscode/test-electron itself, the only lockfile churn is inside the ora dependency tree, which 3.x bumps from ^7 to ^8.

On engines.node

3.x declares engines.node >= 22 while CI runs Node 20, so npm ci emits:

npm warn EBADENGINE Unsupported engine
npm warn EBADENGINE   required: { node: '>=22' }
npm warn EBADENGINE   current: { node: 'v20.18.1' }

This is a warning, not an error — the install completes. Verified on Node 20.18.1 that 3.1.0 loads and resolves executable paths correctly; it uses no Node 22 only APIs and its transitive dependencies all accept >=18. A Node bump is therefore not needed to fix this and is deliberately left out to keep the change minimal.

Verification

  • npm install succeeds; installed version confirmed as 3.1.0.
  • tsc -p ./ --noEmit passes.
  • Executable resolution verified directly against downloadDirToExecutablePath(..., "darwin-arm64") with synthetic bundles: the new layout (CFBundleExecutable=Code) resolves to Code, and the legacy Electron layout still resolves to Electron — so the fix covers the failure without regressing older VS Code versions.

The real confirmation is the macOS job in this PR's own CI run.

Related

Same fix applied across the affected Java extension repos: microsoft/vscode-gradle#1907 and the sibling PRs opened alongside this one.

The macOS job fails on every run while Linux and Windows pass, dying
immediately after the VS Code download with:

    Test error: Error: spawn .../Visual Studio Code.app/Contents/MacOS/Electron ENOENT
    Error: Test run failed with code -2

VS Code 1.110 renamed the macOS main binary inside the app bundle from
`Electron` to the product name (`Code`), keeping a compatibility symlink
under the old name. That symlink was removed in microsoft/vscode#326502,
so every 1.110+ archive now fails to launch. The test runner does not pin
a VS Code version, so it resolves the latest release (1.131.0) and hits
this. Only macOS goes through that code path, which is why the other
platforms pass.

`@vscode/test-electron` ^2.5.2 hardcodes the old path, so the breakage
surfaced as soon as the symlink went away. 3.1.0 resolves the executable
via `CFBundleExecutable` from `Info.plist`, with a fallback to the sole
regular file in `Contents/MacOS/` and finally the legacy `Electron` name,
so both the new and pre-1.110 layouts work.

3.x declares `engines.node >= 22` while CI runs Node 20, but this is a
non-blocking `npm warn EBADENGINE`: the install succeeds, the package
loads, and it uses no Node 22 only APIs. A Node bump is therefore left out
to keep this change minimal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0b39911b-23b6-4180-ae96-2b6c06d2265b
@wenytang-ms
wenytang-ms merged commit ac25d65 into main Aug 3, 2026
33 checks passed
@wenytang-ms
wenytang-ms deleted the fix/test-electron-darwin-executable branch August 3, 2026 03:20
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.

2 participants