Skip to content

Commit 4efa62e

Browse files
authored
chore(smoke-tests): use fs.existsSync instead of running compass to verify installs COMPASS-9406 (#6963)
Use fs.existsSync instead of running compass to verify installs
1 parent 230ba1d commit 4efa62e

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

packages/compass-smoke-tests/src/installers/windows-msi.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import assert from 'node:assert/strict';
22
import path from 'node:path';
3+
import fs from 'node:fs';
4+
35
import createDebug from 'debug';
46

57
import type { InstalledAppInfo, InstallablePackage } from './types';
@@ -46,9 +48,8 @@ export function installWindowsMSI({
4648
'/passive',
4749
`APPLICATIONROOTDIRECTORY=${installDirectory}`,
4850
]);
49-
50-
// Check that the executable will run without being quarantined or similar
51-
execute(appPath, ['--version']);
51+
// Check if the app executable exists after installing
52+
assert(fs.existsSync(appPath), `Expected ${appPath} to exist`);
5253

5354
return {
5455
appName,

packages/compass-smoke-tests/src/installers/windows-setup.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ export function installWindowsSetup({
8282
'Expected an entry in the registry with the install location'
8383
);
8484
const appExecutablePath = path.resolve(appPath, `${appName}.exe`);
85-
execute(appExecutablePath, ['--version']);
85+
86+
// Check if the app executable exists after installing
87+
assert(
88+
fs.existsSync(appExecutablePath),
89+
`Expected ${appExecutablePath} to exist`
90+
);
8691

8792
return {
8893
appName,

packages/compass-smoke-tests/src/installers/windows-zip.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import assert from 'node:assert/strict';
22
import path from 'node:path';
3+
import fs from 'node:fs';
34

45
import type { InstalledAppInfo, InstallablePackage } from './types';
56
import { execute } from '../execute';
@@ -16,8 +17,8 @@ export function installWindowsZIP({
1617

1718
execute('unzip', [filepath, '-d', sandboxPath]);
1819

19-
// see if the executable will run without being quarantined or similar
20-
execute(appPath, ['--version']);
20+
// Check if the app executable exists after unzipping
21+
assert(fs.existsSync(appPath), `Expected ${appPath} to exist`);
2122

2223
return {
2324
appName,

0 commit comments

Comments
 (0)