Skip to content

Commit d4387ff

Browse files
committed
Install extension before running tests
1 parent 9ef095e commit d4387ff

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
NVM_DIR=/usr/local/nvm
5454
CI=1
5555
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
56-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
56+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
5757
GITHUB_TOKEN=${{github.token}}
5858
GITHUB_REPOSITORY=${{github.repository}}
5959
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
@@ -62,7 +62,7 @@ jobs:
6262
windows_env_vars: |
6363
CI=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
@@ -83,7 +83,7 @@ jobs:
8383
CI=1
8484
VSCODE_VERSION=insiders
8585
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
86-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
86+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
8787
GITHUB_TOKEN=${{github.token}}
8888
GITHUB_REPOSITORY=${{github.repository}}
8989
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
@@ -94,7 +94,7 @@ jobs:
9494
CI=1
9595
VSCODE_VERSION=insiders
9696
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
97-
VSCODE_SWIFT_VSIX=${{github.workspace}}\vscode-swift.vsix
97+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
9898
GITHUB_TOKEN=${{github.token}}
9999
GITHUB_REPOSITORY=${{github.repository}}
100100
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1

.vscode-test.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,27 @@ if (dataDir) {
4040
if (process.platform === "darwin" && process.arch === "x64") {
4141
launchArgs.push("--disable-gpu");
4242
}
43-
const vsixPath = process.env["VSCODE_SWIFT_VSIX"];
43+
let vsixPath = process.env["VSCODE_SWIFT_VSIX"];
44+
const install = [];
45+
if (vsixPath) {
46+
if (!path.isAbsolute(vsixPath)) {
47+
vsixPath = path.join(__dirname, vsixPath);
48+
}
49+
console.log("Installing " + vsixPath);
50+
install.push({
51+
label: "installExtension",
52+
installExtensions: ["vadimcn.vscode-lldb", "llvm-vs-code-extensions.lldb-dap"].concat(
53+
vsixPath ? [vsixPath] : []
54+
),
55+
files: [],
56+
version: process.env["VSCODE_VERSION"] ?? "stable",
57+
reuseMachineInstall: !isCIBuild,
58+
});
59+
}
4460

4561
module.exports = defineConfig({
4662
tests: [
63+
...install,
4764
{
4865
label: "integrationTests",
4966
files: ["dist/test/common.js", "dist/test/integration-tests/**/*.test.js"],
@@ -69,9 +86,6 @@ module.exports = defineConfig({
6986
},
7087
},
7188
reuseMachineInstall: !isCIBuild,
72-
installExtensions: ["vadimcn.vscode-lldb", "llvm-vs-code-extensions.lldb-dap"].concat(
73-
vsixPath ? [vsixPath] : []
74-
),
7589
},
7690
{
7791
label: "unitTests",

0 commit comments

Comments
 (0)