Skip to content

Commit 525f523

Browse files
committed
Upgrade from vscode-test to @vscode/test-electron
The `vscode-test` package was renamed to `@vscode/test-electron` in December of last year. This commit updates the extension to use the new package name. The reason for this change is that the `vscode-test` package was somewhat flaky in actually starting VSCode to run the tests from the command line. The new package also has some bugfixes and other improvements which would normally have been part of a new version of the `vscode-test` package.
1 parent 908abb4 commit 525f523

File tree

6 files changed

+61
-64
lines changed

6 files changed

+61
-64
lines changed

extensions/ql-vscode/package-lock.json

Lines changed: 54 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,7 @@
12891289
"@types/xml2js": "~0.4.4",
12901290
"@typescript-eslint/eslint-plugin": "^4.26.0",
12911291
"@typescript-eslint/parser": "^4.26.0",
1292+
"@vscode/test-electron": "^2.1.5",
12921293
"ansi-colors": "^4.1.1",
12931294
"applicationinsights": "^2.3.5",
12941295
"babel-loader": "^8.2.5",
@@ -1327,7 +1328,6 @@
13271328
"typescript": "^4.5.5",
13281329
"typescript-formatter": "^7.2.2",
13291330
"vsce": "^2.7.0",
1330-
"vscode-test": "^1.4.0",
13311331
"webpack": "^5.62.2",
13321332
"webpack-cli": "^4.6.0"
13331333
},

extensions/ql-vscode/src/vscode-tests/cli-integration/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'source-map-support/register';
2-
import 'vscode-test';
32
import { runTestsInDirectory } from '../index-template';
43
import 'mocha';
54
import * as sinonChai from 'sinon-chai';

extensions/ql-vscode/src/vscode-tests/minimal-workspace/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'source-map-support/register';
2-
import 'vscode-test';
32
import * as sinonChai from 'sinon-chai';
43
import * as chai from 'chai';
54
import 'chai/register-should';

extensions/ql-vscode/src/vscode-tests/no-workspace/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'source-map-support/register';
2-
import 'vscode-test';
32
import * as sinonChai from 'sinon-chai';
43
import * as chai from 'chai';
54
import * as chaiAsPromised from 'chai-as-promised';

extensions/ql-vscode/src/vscode-tests/run-integration-tests.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import * as cp from 'child_process';
44
import {
55
runTests,
66
downloadAndUnzipVSCode,
7-
resolveCliPathFromVSCodeExecutablePath
8-
} from 'vscode-test';
7+
resolveCliArgsFromVSCodeExecutablePath
8+
} from '@vscode/test-electron';
99
import { assertNever } from '../pure/helpers-pure';
1010
import * as tmp from 'tmp-promise';
1111

1212
// For some reason, the following are not exported directly from `vscode-test`,
1313
// but we can be tricky and import directly from the out file.
14-
import { TestOptions } from 'vscode-test/out/runTest';
14+
import { TestOptions } from '@vscode/test-electron/out/runTest';
1515

1616

1717
// For CI purposes we want to leave this at 'stable' to catch any bugs
@@ -78,10 +78,11 @@ async function main() {
7878
const extensionTestsEnv: Record<string, string> = {};
7979
if (dirs.includes(TestDir.CliIntegration)) {
8080
console.log('Installing required extensions');
81-
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
81+
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
8282
cp.spawnSync(
83-
cliPath,
83+
cli,
8484
[
85+
...args,
8586
'--install-extension',
8687
'hbenl.vscode-test-explorer',
8788
'--install-extension',

0 commit comments

Comments
 (0)