From 3e37b46bd4c5cdb9e0a8303ba4f2ba253105f76a Mon Sep 17 00:00:00 2001 From: Adam Daniels Date: Wed, 27 Nov 2024 20:09:26 -0500 Subject: [PATCH] Test for presence of shadowenv binary before running Shadowenv suite Not all non-Shopify developer environments have a version of shadowenv installed. In those circumstances, skip the suite with a console warning. Part of #2877 --- vscode/src/test/suite/ruby/shadowenv.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vscode/src/test/suite/ruby/shadowenv.test.ts b/vscode/src/test/suite/ruby/shadowenv.test.ts index 0ba34ceab4..12b9228573 100644 --- a/vscode/src/test/suite/ruby/shadowenv.test.ts +++ b/vscode/src/test/suite/ruby/shadowenv.test.ts @@ -14,13 +14,20 @@ import { LOG_CHANNEL, asyncExec } from "../../../common"; import { RUBY_VERSION } from "../../rubyVersion"; import * as common from "../../../common"; -suite("Shadowenv", () => { +suite("Shadowenv", async () => { if (os.platform() === "win32") { // eslint-disable-next-line no-console console.log("Skipping Shadowenv tests on Windows"); return; } + try { + await asyncExec("shadowenv --version"); + } catch { + console.log("Skipping Shadowenv tests because no `shadowenv` found"); + return; + } + let rootPath: string; let workspacePath: string; let workspaceFolder: vscode.WorkspaceFolder;