From a0c6d947bd3e58e0c18714293c12d1a58c8bbb79 Mon Sep 17 00:00:00 2001 From: James Pogran Date: Tue, 4 Jan 2022 15:32:33 -0500 Subject: [PATCH] Test VS Code Version Matrix 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. --- .github/workflows/test.yml | 6 ++++++ src/test/runTest.ts | 25 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbf819a7bf..232cf24f4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,12 @@ jobs: test: strategy: + fail-fast: false matrix: + vscode: + - '1.55.0' + - 'insiders' + - 'stable' os: - windows-latest - macos-latest @@ -119,3 +124,4 @@ jobs: env: CI: true DISPLAY: ':99.0' + VSCODE_VERSION: ${{ matrix.vscode }} diff --git a/src/test/runTest.ts b/src/test/runTest.ts index 5e67def13b..0efc9e4446 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -41,15 +41,24 @@ async function main(): Promise { // 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);