From 3600a152e8ae2c65d2b7fd66b2269a3028ca587b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sat, 24 May 2025 11:20:09 +0200 Subject: [PATCH] Use fs.existsSync instead of running compass to verify installs --- packages/compass-smoke-tests/src/installers/windows-msi.ts | 7 ++++--- .../compass-smoke-tests/src/installers/windows-setup.ts | 7 ++++++- packages/compass-smoke-tests/src/installers/windows-zip.ts | 5 +++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/compass-smoke-tests/src/installers/windows-msi.ts b/packages/compass-smoke-tests/src/installers/windows-msi.ts index 30135c2317f..09418f2614d 100644 --- a/packages/compass-smoke-tests/src/installers/windows-msi.ts +++ b/packages/compass-smoke-tests/src/installers/windows-msi.ts @@ -1,5 +1,7 @@ import assert from 'node:assert/strict'; import path from 'node:path'; +import fs from 'node:fs'; + import createDebug from 'debug'; import type { InstalledAppInfo, InstallablePackage } from './types'; @@ -46,9 +48,8 @@ export function installWindowsMSI({ '/passive', `APPLICATIONROOTDIRECTORY=${installDirectory}`, ]); - - // Check that the executable will run without being quarantined or similar - execute(appPath, ['--version']); + // Check if the app executable exists after installing + assert(fs.existsSync(appPath), `Expected ${appPath} to exist`); return { appName, diff --git a/packages/compass-smoke-tests/src/installers/windows-setup.ts b/packages/compass-smoke-tests/src/installers/windows-setup.ts index d6332b3716c..4f580d939ca 100644 --- a/packages/compass-smoke-tests/src/installers/windows-setup.ts +++ b/packages/compass-smoke-tests/src/installers/windows-setup.ts @@ -82,7 +82,12 @@ export function installWindowsSetup({ 'Expected an entry in the registry with the install location' ); const appExecutablePath = path.resolve(appPath, `${appName}.exe`); - execute(appExecutablePath, ['--version']); + + // Check if the app executable exists after installing + assert( + fs.existsSync(appExecutablePath), + `Expected ${appExecutablePath} to exist` + ); return { appName, diff --git a/packages/compass-smoke-tests/src/installers/windows-zip.ts b/packages/compass-smoke-tests/src/installers/windows-zip.ts index b90d8a0019b..d73a1bc3c5e 100644 --- a/packages/compass-smoke-tests/src/installers/windows-zip.ts +++ b/packages/compass-smoke-tests/src/installers/windows-zip.ts @@ -1,5 +1,6 @@ import assert from 'node:assert/strict'; import path from 'node:path'; +import fs from 'node:fs'; import type { InstalledAppInfo, InstallablePackage } from './types'; import { execute } from '../execute'; @@ -16,8 +17,8 @@ export function installWindowsZIP({ execute('unzip', [filepath, '-d', sandboxPath]); - // see if the executable will run without being quarantined or similar - execute(appPath, ['--version']); + // Check if the app executable exists after unzipping + assert(fs.existsSync(appPath), `Expected ${appPath} to exist`); return { appName,