From f15c770b1d82babd0360b19fb2a8434265a2b310 Mon Sep 17 00:00:00 2001 From: Chuan-kai Lin Date: Mon, 3 Aug 2026 14:20:38 -0700 Subject: [PATCH] Fix VS Code integration tests on macOS VS Code 1.131 removed the legacy Contents/MacOS/Electron compatibility executable on macOS. Upgrade @vscode/test-electron to 3.1.0 so the test harness resolves the executable from the application bundle metadata instead of trying to launch the removed path. Override jest-runner-vscode's transitive @vscode/test-electron dependency as well. Its declared 2.x range would otherwise cause npm to install a private 2.5.2 copy and leave the runner using the broken executable lookup despite the direct dependency upgrade. Increase the minimal-workspace activation polling and Jest timeouts because extension activation under VS Code 1.131 can take longer on macOS than the previous 30-second allowance. This preserves the activation assertion while avoiding a deterministic timeout on slower macOS hosts. These failures were observed only in local macOS runs. GitHub Actions runs the VS Code integration suite on Linux and Windows, where the existing tests were passing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d7e3c611-18b2-4bf2-8f9a-09e7a8d1ef8e --- extensions/ql-vscode/package-lock.json | 10 +++++----- extensions/ql-vscode/package.json | 7 +++++-- .../vscode-tests/minimal-workspace/activation.test.ts | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/extensions/ql-vscode/package-lock.json b/extensions/ql-vscode/package-lock.json index 50cea68fcad..440560ca41d 100644 --- a/extensions/ql-vscode/package-lock.json +++ b/extensions/ql-vscode/package-lock.json @@ -91,7 +91,7 @@ "@types/yauzl": "^3.4.0", "@typescript-eslint/eslint-plugin": "^8.65.0", "@typescript-eslint/parser": "^8.65.0", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "@vscode/vsce": "^3.9.2", "ansi-colors": "^4.1.1", "applicationinsights": "^2.9.8", @@ -10201,9 +10201,9 @@ "integrity": "sha512-2J27dysaXmvnfuhFGhfeuxfHRXunqNPxtBoR3koiTOA9rdxWNDTa1zIFLCFMSHJ9MPTPKFcBeblsyaCJCIlQxg==" }, "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": { @@ -10214,7 +10214,7 @@ "semver": "^7.6.2" }, "engines": { - "node": ">=16" + "node": ">=22" } }, "node_modules/@vscode/vsce": { diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 76a2507a208..3e4de2d4c2e 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -2149,7 +2149,7 @@ "@types/yauzl": "^3.4.0", "@typescript-eslint/eslint-plugin": "^8.65.0", "@typescript-eslint/parser": "^8.65.0", - "@vscode/test-electron": "^2.5.2", + "@vscode/test-electron": "^3.1.0", "@vscode/vsce": "^3.9.2", "ansi-colors": "^4.1.1", "applicationinsights": "^2.9.8", @@ -2198,7 +2198,10 @@ "d3-graphviz": { "@hpcc-js/wasm": "2.30.0" }, - "@azure/identity": "^4.13.1" + "@azure/identity": "^4.13.1", + "jest-runner-vscode": { + "@vscode/test-electron": "^3.1.0" + } }, "lint-staged": { "./**/*.{json,css,scss}": [ diff --git a/extensions/ql-vscode/test/vscode-tests/minimal-workspace/activation.test.ts b/extensions/ql-vscode/test/vscode-tests/minimal-workspace/activation.test.ts index f77c29642a5..6bce822ef0b 100644 --- a/extensions/ql-vscode/test/vscode-tests/minimal-workspace/activation.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/minimal-workspace/activation.test.ts @@ -24,9 +24,9 @@ describe("launching with a minimal workspace", () => { const document = await workspace.openTextDocument(documentPath); expect(document.languageId).toEqual("ql"); // Wait for the extension to activate, polling with a timeout. - await waitForActivation(ext!, 30_000); + await waitForActivation(ext!, 90_000); expect(ext!.isActive).toBeTruthy(); - }, 60_000); + }, 120_000); async function waitForActivation( extension: Extension,