From a7a2b81f6b83faddb604d3f2c24578f0492bc25c Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Wed, 13 Nov 2024 18:44:50 +0000 Subject: [PATCH] Try to get dependent extensions in place for CI tests --- src/test/runTest.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/test/runTest.ts b/src/test/runTest.ts index a3aa4b6..603b854 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -19,19 +19,25 @@ async function main() { const vscodeExecutablePath = await downloadAndUnzipVSCode("stable"); const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); - const installExtension = (extId) => - cp.spawnSync(cli, [...args, "--install-extension", extId], { - encoding: "utf-8", - stdio: "inherit", - }); - // Install dependent extensions - installExtension("intersystems-community.servermanager"); - installExtension("intersystems-community.vscode-objectscript"); + // Use cp.spawn / cp.exec for custom setup + cp.spawnSync( + cli, + [...args, '--install-extension', 'intersystems-community.servermanager', '--install-extension', 'intersystems-community.vscode-objectscript'], + { + encoding: 'utf-8', + stdio: 'inherit' + } + ); - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { + // Run the extension test + await runTests({ + // Use the specified `code` executable + vscodeExecutablePath, + extensionDevelopmentPath, + extensionTestsPath + }); + } catch (err) { console.error("Failed to run tests", err); process.exit(1); }