Skip to content

Commit b57b201

Browse files
committed
Install extension before running tests
1 parent 84b6236 commit b57b201

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.github/workflows/nightly.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
NVM_DIR=/usr/local/nvm
5353
CI=1
5454
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
55-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
55+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
5656
GITHUB_TOKEN=${{github.token}}
5757
GITHUB_REPOSITORY=${{github.repository}}
5858
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
@@ -62,7 +62,7 @@ jobs:
6262
CI=1
6363
VSCODE_TEST=1
6464
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
65-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
65+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
6666
GITHUB_TOKEN=${{github.token}}
6767
GITHUB_REPOSITORY=${{github.repository}}
6868
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
@@ -84,7 +84,7 @@ jobs:
8484
VSCODE_TEST=1
8585
VSCODE_VERSION=insiders
8686
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
87-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
87+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
8888
GITHUB_TOKEN=${{github.token}}
8989
GITHUB_REPOSITORY=${{github.repository}}
9090
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
@@ -96,7 +96,7 @@ jobs:
9696
VSCODE_TEST=1
9797
VSCODE_VERSION=insiders
9898
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
99-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
99+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
100100
GITHUB_TOKEN=${{github.token}}
101101
GITHUB_REPOSITORY=${{github.repository}}
102102
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1

.vscode-test.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,25 @@ const isDebugRun = !(process.env["_"] ?? "").endsWith("node_modules/.bin/vscode-
2525
// so tests don't timeout when a breakpoint is hit
2626
const timeout = isDebugRun ? Number.MAX_SAFE_INTEGER : 3000;
2727

28-
const vsixPath = process.env["VSCODE_SWIFT_VSIX"];
28+
let vsixPath = process.env["VSCODE_SWIFT_VSIX"];
29+
const install = [];
30+
if (vsixPath) {
31+
if (!path.isAbsolute(vsixPath)) {
32+
vsixPath = path.join(__dirname, vsixPath);
33+
}
34+
console.log("Installing " + vsixPath);
35+
install.push({
36+
label: "installExtension",
37+
installExtensions: vsixPath ? [vsixPath] : [],
38+
files: [],
39+
version: process.env["VSCODE_VERSION"] ?? "stable",
40+
reuseMachineInstall: !isCIBuild,
41+
});
42+
}
2943

3044
module.exports = defineConfig({
3145
tests: [
46+
...install,
3247
{
3348
label: "integrationTests",
3449
files: ["dist/test/common.js", "dist/test/integration-tests/**/*.test.js"],
@@ -59,7 +74,6 @@ module.exports = defineConfig({
5974
},
6075
},
6176
reuseMachineInstall: !isCIBuild,
62-
installExtensions: ["vadimcn.vscode-lldb"].concat(vsixPath ? [vsixPath] : []),
6377
},
6478
{
6579
label: "unitTests",

0 commit comments

Comments
 (0)