Skip to content

Commit

Permalink
Test VS Code Version Matrix
Browse files Browse the repository at this point in the history
Change default `npm test` behavior to use the version of VS Code specified in the `VSCODE_VER` environment variable, instead of testing hardcoded versions inside `runtest.ts`.

`VSCODE_VER` supports stable, insiders and version numbers like 1.55.0.

If the `VSCODE_VER` environment variable is not specified, then the latest stable version of VS Code is automatically used.
  • Loading branch information
jpogran committed Jan 6, 2022
1 parent 7dc861c commit a0c6d94
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ jobs:

test:
strategy:
fail-fast: false
matrix:
vscode:
- '1.55.0'
- 'insiders'
- 'stable'
os:
- windows-latest
- macos-latest
Expand Down Expand Up @@ -119,3 +124,4 @@ jobs:
env:
CI: true
DISPLAY: ':99.0'
VSCODE_VERSION: ${{ matrix.vscode }}
25 changes: 17 additions & 8 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,24 @@ async function main(): Promise<void> {
// Download VS Code, unzip it and run the integration test
// start in the fixtures folder to prevent the language server from walking all the
// project root folders, like node_modules
console.log('_______________LATEST_____________________');
await runTests(options);

console.log('_______________INSIDERS___________________');
options.version = 'insiders';
await runTests(options);
const vscodeVersion = process.env['VSCODE_VERSION'];
switch (vscodeVersion) {
case undefined:
console.log('_______________LATEST_____________________');
break;
case 'stable':
console.log('_______________LATEST_____________________');
break;
case 'insiders':
console.log('_______________INSIDERS_____________________');
options.version = vscodeVersion;
break;
default:
console.log(`_______________${vscodeVersion}_____________________`);
options.version = vscodeVersion;
break;
}

console.log('________________1.55.0____________________');
options.version = '1.55.0';
await runTests(options);
} catch (err) {
console.error(err);
Expand Down

0 comments on commit a0c6d94

Please sign in to comment.