From 7c28653a6764f0cfba0cecb874b814ff89a2c7fe Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Mon, 3 Aug 2026 11:07:14 +0800 Subject: [PATCH] fix(ci): upgrade @vscode/test-electron to fix macOS test failures 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 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index fdf7d222..a087b369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "@types/node": "20.x", "@types/semver": "^7.3.13", "@types/vscode": "1.95.0", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "copy-webpack-plugin": "^11.0.0", "glob": "^7.2.3", "mocha": "^11.7.5", @@ -752,9 +752,9 @@ } }, "node_modules/@vscode/test-electron": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz", - "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.1.0.tgz", + "integrity": "sha512-CRqv5u+YYoseuNVJ6Tyo4k0sF0mx4qnKMihRB0PjsUF8Dc0WKtCXo6CNL6nWWm5esfFQsQA/pejMj4ZbpJVLTw==", "dev": true, "license": "MIT", "dependencies": { @@ -765,7 +765,7 @@ "semver": "^7.6.2" }, "engines": { - "node": ">=16" + "node": ">=22" } }, "node_modules/@webassemblyjs/ast": { @@ -4726,9 +4726,9 @@ } }, "@vscode/test-electron": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz", - "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.1.0.tgz", + "integrity": "sha512-CRqv5u+YYoseuNVJ6Tyo4k0sF0mx4qnKMihRB0PjsUF8Dc0WKtCXo6CNL6nWWm5esfFQsQA/pejMj4ZbpJVLTw==", "dev": true, "requires": { "http-proxy-agent": "^7.0.2", diff --git a/package.json b/package.json index 312eb543..4cc58328 100644 --- a/package.json +++ b/package.json @@ -1204,7 +1204,7 @@ "@types/node": "20.x", "@types/semver": "^7.3.13", "@types/vscode": "1.95.0", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "copy-webpack-plugin": "^11.0.0", "glob": "^7.2.3", "mocha": "^11.7.5",