From 5339b4c5002052712afa96d3da96dbbf7c9e79a2 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sun, 26 Jun 2022 19:51:02 +0100 Subject: [PATCH] Replace vscode-test with @vscode/test-electron (#533) * Replace vscode-test with @vscode/test-electron Related: https://github.com/microsoft/vscode-test/issues/153 * chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- package.json | 2 +- test/testRunner.ts | 14 ++++++++++++-- yarn.lock | 26 +++++++++++++------------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 25e371848..64daa28d2 100644 --- a/package.json +++ b/package.json @@ -435,6 +435,7 @@ "@types/vscode": "^1.48.0", "@typescript-eslint/eslint-plugin": "^5.26.0", "@typescript-eslint/parser": "^5.26.0", + "@vscode/test-electron": "^2.1.4", "chai": "^4.3.6", "copyfiles": "^2.4.1", "eslint": "^8.16.0", @@ -449,7 +450,6 @@ "typescript": "^4.6.4", "vsce": "^2.9.2", "vscode-extension-tester": "https://github.com/ssbarnea/vscode-extension-tester#master", - "vscode-test": "^1.6.1", "webpack": "^5.72.1", "webpack-cli": "^4.9.2", "yarn-audit-fix": "^9.3.2" diff --git a/test/testRunner.ts b/test/testRunner.ts index 30ed85218..01808693a 100644 --- a/test/testRunner.ts +++ b/test/testRunner.ts @@ -4,7 +4,7 @@ import { runTests, downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, -} from "vscode-test"; +} from "@vscode/test-electron"; import fs from "fs"; export const FIXTURES_BASE_PATH = path.join("test", "testFixtures"); @@ -17,7 +17,17 @@ export const ANSIBLE_COLLECTIONS_FIXTURES_BASE_PATH = path.resolve( async function main(): Promise { try { const executable = await downloadAndUnzipVSCode(); - const cliPath = resolveCliPathFromVSCodeExecutablePath(executable); + const downloadPlatform = + process.platform === "darwin" + ? "darwin" + : process.platform === "win32" + ? "win32-archive" + : "linux-x64"; + + const cliPath = resolveCliPathFromVSCodeExecutablePath( + executable, + downloadPlatform + ); const userDataPath = path.resolve(__dirname, "../../userdata"); const extPath = path.resolve(__dirname, "../../ext"); // We want to avoid using developer data dir as this is likely to break diff --git a/yarn.lock b/yarn.lock index ba91b206c..12f7a2ec7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -622,6 +622,18 @@ __metadata: languageName: node linkType: hard +"@vscode/test-electron@npm:^2.1.4": + version: 2.1.4 + resolution: "@vscode/test-electron@npm:2.1.4" + dependencies: + http-proxy-agent: ^4.0.1 + https-proxy-agent: ^5.0.0 + rimraf: ^3.0.2 + unzipper: ^0.10.11 + checksum: 2a541f70689cfdbfd911884caeba2fabf0bfeede4ee11b77bd97e8bd4bb6388341c7785230a05696b590e9aa6513d29b18ce82cc85965e664710ce4decc19b03 + languageName: node + linkType: hard + "@webassemblyjs/ast@npm:1.11.1": version: 1.11.1 resolution: "@webassemblyjs/ast@npm:1.11.1" @@ -983,6 +995,7 @@ __metadata: "@types/vscode": ^1.48.0 "@typescript-eslint/eslint-plugin": ^5.26.0 "@typescript-eslint/parser": ^5.26.0 + "@vscode/test-electron": ^2.1.4 chai: ^4.3.6 copyfiles: ^2.4.1 eslint: ^8.16.0 @@ -1000,7 +1013,6 @@ __metadata: vsce: ^2.9.2 vscode-extension-tester: "https://github.com/ssbarnea/vscode-extension-tester#master" vscode-languageclient: ^7.0.0 - vscode-test: ^1.6.1 webpack: ^5.72.1 webpack-cli: ^4.9.2 yarn-audit-fix: ^9.3.2 @@ -6465,18 +6477,6 @@ __metadata: languageName: node linkType: hard -"vscode-test@npm:^1.6.1": - version: 1.6.1 - resolution: "vscode-test@npm:1.6.1" - dependencies: - http-proxy-agent: ^4.0.1 - https-proxy-agent: ^5.0.0 - rimraf: ^3.0.2 - unzipper: ^0.10.11 - checksum: 37779441eaccfe7eb4c5ec53950441d2084b213010c6cb40855d4126f41140d021dbc12388da025df0f2ea1bfa85a4e5bcdd7c13bf78144dee18fa9b35c90793 - languageName: node - linkType: hard - "vscode-uri@npm:^3.0.3": version: 3.0.3 resolution: "vscode-uri@npm:3.0.3"