From 8e3c73c2d9600ee79ddd86e132a70ecbd5b865d7 Mon Sep 17 00:00:00 2001 From: Lukas Bockstaller Date: Fri, 10 Nov 2023 11:10:10 +0100 Subject: [PATCH] Pin and test all vscode packages (#899) * test stated version compatibility this commit adds a new testing mode whereby the extension is tested against the stated minimum vscode compatibility this test fails in this commit due to a minimum @types/vscode requirement of the lsp packages that breaks during runtime Signed-off-by: Lukas Bockstaller * pins vscode and lsp package versions coherently the compatibility tests (and using the plugin with any version <1.82.0) currently fails with Error: The language client requires VS Code version ^1.82.0 but received version 1.63.1 This commit pins the versions so that doesn't occur anymore. Rationale for the versions: We need at least @types/vscode=~1.67.0 to use the newer client start api: const client: LanguageClient = ...; await client.start(); instead of const client: LanguageClient = ...; client.start(); await client.onReady(); and the LanguageClient#dispose method. But @types/vscode=~1.67.0 has an issue where running tests modifies the package.json (https://github.com/microsoft/vscode/issues/148975) which is fixed in ~1.71.0. The LSP packages are then selected to keep backwards compatibility with ~1.71.0 Signed-off-by: Lukas Bockstaller * adds missing sinon types Signed-off-by: Lukas Bockstaller * Remove svg image links Signed-off-by: Zabil Cheriya Maliackal * bumps version for release Signed-off-by: Lukas Bockstaller * removes direct dependency to vscode-jsonrpc and vscode-languageclient-protocol Signed-off-by: Lukas Bockstaller * bumps test timeout Signed-off-by: Lukas Bockstaller * De-duplicate transitive dependencies Signed-off-by: Chad Wilson * Simplify dependabot grouping rules Signed-off-by: Chad Wilson --------- Signed-off-by: Lukas Bockstaller Signed-off-by: Zabil Cheriya Maliackal Signed-off-by: Chad Wilson Co-authored-by: Zabil Cheriya Maliackal Co-authored-by: Chad Wilson --- .github/dependabot.yml | 10 ++- .github/workflows/vscode.yml | 16 ++++ README.md | 4 - package-lock.json | 150 +++++++++++++++++-------------- package.json | 12 +-- src/gaugeWorkspace.proposed.ts | 4 +- src/protocol/gauge.proposed.ts | 3 +- test/execution/execution.test.ts | 12 +-- test/runTest.ts | 36 +++++++- tsconfig.json | 1 + 10 files changed, 153 insertions(+), 95 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4f759924..ad804cd6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,12 @@ updates: schedule: interval: weekly groups: - vscode: + mocha: patterns: - - "vscode-*" + - "*mocha*" + fs-extra: + patterns: + - "*fs-extra*" + sinon: + patterns: + - "*sinon*" \ No newline at end of file diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 877509ab..7092ef0b 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -42,17 +42,33 @@ jobs: run: | xvfb-run --auto-servernum npm test + - name: Run compatibility tests (linux) + if: matrix.os == 'ubuntu-latest' + run: | + xvfb-run --auto-servernum npm run compatibilityTest + - name: Run tests (macos) if: matrix.os == 'macos-latest' run: | npm test + - name: Run compatibility tests (macos) + if: matrix.os == 'macos-latest' + run: | + npm run compatibilityTest + - name: Run tests (windows) if: matrix.os == 'windows-latest' shell: pwsh run: | npm test + - name: Run compatibility tests (windows) + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + npm run compatibilityTest + - name: Upload logs uses: actions/upload-artifact@v3 if: failure() diff --git a/README.md b/README.md index c1ae557e..39c3e014 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -[![Released Version](https://vsmarketplacebadge.apphb.com/version-short/getgauge.gauge.svg)](https://marketplace.visualstudio.com/items?itemName=getgauge.gauge) -[![Actions Status](https://github.com/getgauge/gauge-vscode/workflows/vscode/badge.svg)](https://github.com/getgauge/gauge-vscode/actions) -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) - Gauge extension for [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=getgauge.gauge) # Install diff --git a/package-lock.json b/package-lock.json index 464df5d1..731ba8ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,19 @@ { "name": "gauge", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gauge", - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "dependencies": { "clipboardy": "^4.0.0", "fs-extra": "^11.1.1", "get-port": "^5.1.1", "ps-tree": "^1.2.0", - "vscode-jsonrpc": "^8.2.0", - "vscode-languageclient": "^9.0.1", - "vscode-languageserver-protocol": "~3.17.5", + "vscode-languageclient": "~8.1.0", "xmlbuilder": "^15.1.1" }, "devDependencies": { @@ -23,7 +21,8 @@ "@types/mocha": "^10.0.3", "@types/node": "^20.8.9", "@types/ps-tree": "^1.1.4", - "@types/vscode": "~1.63.1", + "@types/sinon": "^17.0.1", + "@types/vscode": "~1.71.0", "@vscode/test-electron": "^2.3.6", "cross-env": "^7.0.3", "glob": "^10.3.10", @@ -39,7 +38,7 @@ "webpack-cli": "^5.1.4" }, "engines": { - "vscode": "^1.63.1" + "vscode": "^1.71.0" } }, "node_modules/@babel/code-frame": { @@ -368,9 +367,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.44.6", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.6.tgz", - "integrity": "sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw==", + "version": "8.44.7", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.7.tgz", + "integrity": "sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==", "dev": true, "dependencies": { "@types/estree": "*", @@ -378,9 +377,9 @@ } }, "node_modules/@types/eslint-scope": { - "version": "3.7.6", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.6.tgz", - "integrity": "sha512-zfM4ipmxVKWdxtDaJ3MP3pBurDXOCoyjvlpE3u6Qzrmw4BPbfm4/ambIeTk/r/J0iq/+2/xp0Fmt+gFvXJY2PQ==", + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", "dev": true, "dependencies": { "@types/eslint": "*", @@ -388,15 +387,15 @@ } }, "node_modules/@types/estree": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", - "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/fs-extra": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.3.tgz", - "integrity": "sha512-sF59BlXtUdzEAL1u0MSvuzWd7PdZvZEtnaVkzX5mjpdWTJ8brG0jUqve3jPCzSzvAKKMHTG8F8o/WMQLtleZdQ==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", + "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", "dev": true, "dependencies": { "@types/jsonfile": "*", @@ -404,45 +403,60 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", - "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/jsonfile": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.3.tgz", - "integrity": "sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", + "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz", - "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", + "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", "dev": true }, "node_modules/@types/node": { - "version": "20.8.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", - "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/@types/ps-tree": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@types/ps-tree/-/ps-tree-1.1.4.tgz", - "integrity": "sha512-CJyu2BqU/aZN/s8Ili3jiMctqXfTjCaWXirEcjRD8y1lUQZJ8eNohnal8+LXeWFs1VbdAOrCIdgATFsv+lnQ5Q==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@types/ps-tree/-/ps-tree-1.1.5.tgz", + "integrity": "sha512-3LU5a3EZYI1/HvvOkQmmVGrdXopwKXpr3K5cxlZ0zRiP0QzW7IH0o1z4UDI7KdnyQnpPfYHXOOqflEXIl23LFw==", + "dev": true + }, + "node_modules/@types/sinon": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.1.tgz", + "integrity": "sha512-Q2Go6TJetYn5Za1+RJA1Aik61Oa2FS8SuJ0juIqUuJ5dZR4wvhKfmSdIqWtQ3P6gljKWjW0/R7FZkA4oXVL6OA==", + "dev": true, + "dependencies": { + "@types/sinonjs__fake-timers": "*" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", + "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", "dev": true }, "node_modules/@types/vscode": { - "version": "1.63.2", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.63.2.tgz", - "integrity": "sha512-awvdx4vX7SkMKyvWIlRjycjb4blYRSQI3Bav0YMn+lJLGN6gJgb20urN/dQCv/2ejDu5S6ADEBt6O15DOpIAkg==", + "version": "1.71.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.71.0.tgz", + "integrity": "sha512-nB50bBC9H/x2CpwW9FzRRRDrTZ7G0/POttJojvN/LiVfzTGfLyQIje1L1QRMdFXK9G41k5UJN/1B9S4of7CSzA==", "dev": true }, "node_modules/@vscode/test-electron": { @@ -983,9 +997,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001559", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001559.tgz", - "integrity": "sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA==", + "version": "1.0.30001561", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", + "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", "dev": true, "funding": [ { @@ -1462,9 +1476,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.571", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.571.tgz", - "integrity": "sha512-Sc+VtKwKCDj3f/kLBjdyjMpNzoZsU6WuL/wFb6EH8USmHEcebxRXcRrVpOpayxd52tuey4RUDpUsw5OS5LhJqg==", + "version": "1.4.580", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.580.tgz", + "integrity": "sha512-T5q3pjQon853xxxHUq3ZP68ZpvJHuSMY2+BZaW3QzjS4HvNuvsMmZ/+lU+nCrftre1jFZ+OSlExynXWBihnXzw==", "dev": true }, "node_modules/emoji-regex": { @@ -1508,9 +1522,9 @@ } }, "node_modules/envinfo": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", - "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.0.tgz", + "integrity": "sha512-G9/6xF1FPbIw0TtalAMaVPpiq2aDEuKLXM314jPVAO9r2fo2a4BLqMNkmRS7O/xPPZ+COAhGIz3ETvHEV3eUcg==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -1520,9 +1534,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", - "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.0.tgz", + "integrity": "sha512-lcCr3v3OLezdfFyx9r5NRYHOUTQNnFEQ9E87Mx8Kc+iqyJNkO7MJoB4GQRTlIMw9kLLTwGw0OAkm4BQQud/d9g==", "dev": true }, "node_modules/escalade": { @@ -4349,9 +4363,9 @@ "dev": true }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "engines": { "node": ">= 10.0.0" } @@ -4574,24 +4588,24 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageclient": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz", - "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz", + "integrity": "sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing==", "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.17.3" }, "engines": { - "vscode": "^1.82.0" + "vscode": "^1.67.0" } }, "node_modules/vscode-languageclient/node_modules/minimatch": { @@ -4606,18 +4620,18 @@ } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "node_modules/watchpack": { "version": "2.4.0", diff --git a/package.json b/package.json index 4983df5c..266aa9f7 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "description": "Gauge support for VScode.", "author": "ThoughtWorks", "license": "MIT", - "version": "0.1.3", + "version": "0.1.4", "publisher": "getgauge", "engines": { - "vscode": "^1.63.1" + "vscode": "^1.71.0" }, "categories": [ "Programming Languages" @@ -455,6 +455,7 @@ "pack": "webpack-cli --env production", "build": "npm install && npm run lint && npm run compile && npm run pack && vsce package", "test": "node out/test/runTest.js", + "compatibilityTest": "node out/test/runTest.js --compatibility", "publish": "vsce publish" }, "devDependencies": { @@ -462,7 +463,8 @@ "@types/mocha": "^10.0.3", "@types/node": "^20.8.9", "@types/ps-tree": "^1.1.4", - "@types/vscode": "~1.63.1", + "@types/sinon": "^17.0.1", + "@types/vscode": "~1.71.0", "@vscode/test-electron": "^2.3.6", "cross-env": "^7.0.3", "glob": "^10.3.10", @@ -482,9 +484,7 @@ "fs-extra": "^11.1.1", "get-port": "^5.1.1", "ps-tree": "^1.2.0", - "vscode-jsonrpc": "^8.2.0", - "vscode-languageclient": "^9.0.1", - "vscode-languageserver-protocol": "~3.17.5", + "vscode-languageclient": "~8.1.0", "xmlbuilder": "^15.1.1" } } diff --git a/src/gaugeWorkspace.proposed.ts b/src/gaugeWorkspace.proposed.ts index 0e4ee180..e29c8da5 100644 --- a/src/gaugeWorkspace.proposed.ts +++ b/src/gaugeWorkspace.proposed.ts @@ -1,9 +1,7 @@ 'use strict'; import { workspace, Disposable } from 'vscode'; -import { DynamicFeature, RegistrationData, BaseLanguageClient, RequestType0, FeatureState } from 'vscode-languageclient'; - -import { ClientCapabilities, InitializedParams } from 'vscode-languageserver-protocol'; +import { DynamicFeature, RegistrationData, BaseLanguageClient, FeatureState, ClientCapabilities, InitializedParams, RequestType0 } from 'vscode-languageclient'; import { SaveFilesRequest, GaugeClientCapabilities } from './protocol/gauge.proposed'; diff --git a/src/protocol/gauge.proposed.ts b/src/protocol/gauge.proposed.ts index ed00261a..319272e8 100644 --- a/src/protocol/gauge.proposed.ts +++ b/src/protocol/gauge.proposed.ts @@ -1,5 +1,4 @@ -import { RequestHandler0, CancellationToken, RequestType0 } from 'vscode-languageserver-protocol'; -import { HandlerResult } from 'vscode-jsonrpc'; +import { CancellationToken, HandlerResult, RequestHandler0, RequestType0 } from 'vscode-languageclient'; export interface GaugeClientCapabilities { /** diff --git a/test/execution/execution.test.ts b/test/execution/execution.test.ts index 2569be25..e19839bd 100644 --- a/test/execution/execution.test.ts +++ b/test/execution/execution.test.ts @@ -44,12 +44,12 @@ suite('Gauge Execution Tests', () => { let scenario = spec.fsPath + ":6"; let status = await commands.executeCommand(GaugeVSCodeCommands.Execute, scenario); assertStatus(status); - }).timeout(20000); + }).timeout(30000); test('should execute all specification in spec dir', async () => { let status = await commands.executeCommand(GaugeVSCodeCommands.ExecuteAllSpecs); assertStatus(status); - }).timeout(20000); + }).timeout(30000); test('should execute currently open specification', async () => { let specFile = Uri.file(path.join(testDataPath, 'specs', 'example.spec')); @@ -57,7 +57,7 @@ suite('Gauge Execution Tests', () => { await window.showTextDocument(doc); let status = await commands.executeCommand(GaugeVSCodeCommands.ExecuteSpec); assertStatus(status); - }).timeout(20000); + }).timeout(30000); test('should execute scenario at cursor', async () => { let specFile = Uri.file(path.join(testDataPath, 'specs', 'example.spec')); @@ -67,7 +67,7 @@ suite('Gauge Execution Tests', () => { window.activeTextEditor.selection = new Selection(8, 0, 8, 0); let status = await commands.executeCommand(GaugeVSCodeCommands.ExecuteScenario); assertStatus(status); - }).timeout(20000); + }).timeout(30000); test('should abort execution', async () => { let spec = path.join(testDataPath, 'specs', 'example.spec'); @@ -79,7 +79,7 @@ suite('Gauge Execution Tests', () => { setTimeout(() => commands.executeCommand(GaugeVSCodeCommands.StopExecution), 100); let status = await commands.executeCommand(GaugeVSCodeCommands.Execute, spec); assertStatus(status, false); - }); + }).timeout(30000); test('should reject execution when another is already in progress', async () => { let expectedErrorMessage; @@ -95,5 +95,5 @@ suite('Gauge Execution Tests', () => { } catch { assert.equal(expectedErrorMessage, "A Specification or Scenario is still running!"); } - }).timeout(20000); + }).timeout(30000); }); diff --git a/test/runTest.ts b/test/runTest.ts index f1e14c4c..a86937e0 100644 --- a/test/runTest.ts +++ b/test/runTest.ts @@ -1,19 +1,26 @@ import { runTests } from '@vscode/test-electron'; import * as path from 'path'; +import { engines } from "../package.json"; -async function go() { +async function go(version?: string) { try { const extensionDevelopmentPath = path.resolve(__dirname, '../../'); const extensionTestsPath = path.resolve(__dirname, './'); const testWorkspace = path.resolve(__dirname, '../../test/testdata/sampleProject'); + if (version===undefined){ + // run tests with current stable vscode version + version = "stable"; + } + console.log(`Running tests with version: ${version}`) + await runTests({ extensionDevelopmentPath, extensionTestsPath, - launchArgs: [testWorkspace, '--disable-extensions'] + launchArgs: [testWorkspace, '--disable-extensions'], + version: version }); - } catch (err) { console.error('---Failed to run tests---'); console.error(err); @@ -21,4 +28,25 @@ async function go() { } } -go() \ No newline at end of file +console.log(process.argv); + +if (process.argv[2] && process.argv[2] === '--compatibility') { + // Running the tests with the minimum vscode version that this plugin supports. + // The version is directly taken from this plugins package version + // + // This rerun is here to catch incompatibilities of @types/vscode with the lsp + // packages vscode-languageclient + + // Upgrading vscode-languageclient might require a @types/vscode version bump + // (these version bumps are not mentioned in their release notes). + // Bumping @types/vscode will require bumping the minimum supported vscode version in + // package.json (engines["vscode"]) as well. + // The value of engines["vscode"] cannot be a pinned version "~1.67.0" but must use the + // minimum version notation "^1.67.0" indicating that this is the minimum supported + // vscode version + const version = engines["vscode"].replace("^", ""); + go(version) +} else { + go() +} + diff --git a/tsconfig.json b/tsconfig.json index 43153339..314bfa67 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "lib": ["es2016"], "sourceMap": true, "skipLibCheck": true, + "resolveJsonModule": true, }, "exclude": [ "node_modules"