From f78bdb0db9bf7fe8393df708f336e168267c8d39 Mon Sep 17 00:00:00 2001 From: idillon Date: Wed, 22 Nov 2023 14:18:17 -0500 Subject: [PATCH] Chore: Add mads-hartmann.bash-ide-vscode and ms-python.python as dependencies --- .vscode/launch.json | 1 - client/package.json | 4 ++++ integration-tests/src/runTest.ts | 33 ++++++++++++++++++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 861fc9cd..13e54674 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -49,7 +49,6 @@ "args": [ "--extensionDevelopmentPath=${workspaceRoot}/client", "--extensionTestsPath=${workspaceRoot}/integration-tests/out/index", - "--disable-extensions", "--disable-workspace-trust", "${workspaceRoot}/integration-tests/project-folder" ], diff --git a/client/package.json b/client/package.json index 5069e57b..6fc4dc2e 100644 --- a/client/package.json +++ b/client/package.json @@ -25,6 +25,10 @@ "engines": { "vscode": "^1.75.0" }, + "extensionDependencies": [ + "mads-hartmann.bash-ide-vscode", + "ms-python.python" + ], "categories": [ "Programming Languages" ], diff --git a/integration-tests/src/runTest.ts b/integration-tests/src/runTest.ts index d9a609cb..a2ec5dde 100644 --- a/integration-tests/src/runTest.ts +++ b/integration-tests/src/runTest.ts @@ -3,12 +3,31 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ +import * as cp from 'child_process' import * as path from 'path' - -import { runTests } from '@vscode/test-electron' +import { + downloadAndUnzipVSCode, + resolveCliArgsFromVSCodeExecutablePath, + runTests +} from '@vscode/test-electron' async function main (): Promise { try { + const vscodeExecutablePath = await downloadAndUnzipVSCode('1.84.2') + const [cliPath, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath) + + cp.spawnSync( + cliPath, + [ + ...args, + '--install-extension', 'mads-hartmann.bash-ide-vscode@1.39.0', + '--install-extension', 'ms-python.python@2023.20.0' + ], + { + encoding: 'utf-8', + stdio: 'inherit' + } + ) // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` const extensionDevelopmentPath = path.resolve(__dirname, '../../client/') @@ -19,11 +38,17 @@ async function main (): Promise { const testWorkspace = path.resolve(__dirname, '../../integration-tests/project-folder') - const launchArgs = ['--disable-extensions', '--disable-workspace-trust', testWorkspace] + const launchArgs = ['--disable-workspace-trust', testWorkspace] const extensionTestsEnv = {} // Download VS Code, unzip it and run the integration test - await runTests({ launchArgs, extensionDevelopmentPath, extensionTestsPath, extensionTestsEnv }) + await runTests({ + launchArgs, + vscodeExecutablePath, + extensionDevelopmentPath, + extensionTestsPath, + extensionTestsEnv + }) } catch (err) { console.error(err) console.error('Failed to run tests')