fix(ci): upgrade @vscode/test-electron to fix macOS test failures - #1664
Merged
Conversation
The macOS job is not red yet only because its last run predates the
1.131.0 release; the same failure is already reproducing in sibling repos
(microsoft/vscode-java-test, microsoft/vscode-java-dependency,
microsoft/vscode-spring-boot-dashboard) and this repo will hit it on its
next macOS run. It downloads VS Code unpinned and is on an affected
`@vscode/test-electron`, so it has the same exposure:
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.4.1 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.
`skipLibCheck` is enabled alongside the bump. 3.1.0 ships declarations that
use the generic `Buffer<ArrayBufferLike>`, which this repo's TypeScript 4.9
and older `@types/node` cannot resolve, so the upgrade otherwise fails to
compile with `TS2315: Type 'Buffer' is not generic`. Raising `@types/node`
instead was tried and pulls in unrelated type breakage, and sibling repos
(vscode-java-dependency, vscode-spring-boot-dashboard) already set
`skipLibCheck`, so this keeps the repos consistent.
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
requested review from
chagong,
jdneo and
testforstephen
as code owners
August 3, 2026 03:08
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
chagong
approved these changes
Aug 3, 2026
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.
Problem
This repo is not red yet, but only because its last macOS run predates the VS Code 1.131.0 release. The identical failure is already reproducing in sibling repos — vscode-java-test, vscode-java-dependency, vscode-spring-boot-dashboard — each with the same signature:
This repo downloads VS Code unpinned (so it resolves 1.131.0) and is on an affected
@vscode/test-electron, so its next macOS run will fail the same way. This is a pre-emptive fix.Root cause
VS Code 1.110 renamed the macOS main binary inside the
.appbundle from the historicalElectronto 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.4.1 hardcodes the old path inout/util.js: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
CFBundleExecutableinInfo.plist, falling back to the sole regular file inContents/MacOS/and finally to the legacyElectronname, 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.4.1→^3.1.0.package.json(+ lockfile) and one line intsconfig.json.Beyond
@vscode/test-electronitself, the only lockfile churn is inside theoradependency tree, which 3.x bumps from^7to^8.Why
skipLibCheck3.1.0 ships declarations using the generic
Buffer<ArrayBufferLike>, which needs@types/node>= 22. This repo is on TypeScript 4.9 with older@types/node, so the upgrade alone fails to compile:Raising
@types/nodewas tried first and is not viable — on vscode-java-test it kept theBuffererror and introduced unrelated breakage insrc/controller/utils.ts.skipLibCheckis the standard remedy for third-party declaration mismatches, and sibling reposvscode-java-dependencyandvscode-spring-boot-dashboardalready enable it, so this also brings the repos in line with each other.On
engines.node3.x declares
engines.node >= 22while CI runs Node 20, sonpm ciemits: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 installsucceeds; installed version confirmed as 3.1.0.tsc -p ./ --noEmitpasses.downloadDirToExecutablePath(..., "darwin-arm64")with synthetic bundles: the new layout (CFBundleExecutable=Code) resolves toCode, and the legacyElectronlayout still resolves toElectron— 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.