From b7c235cfe019020104d5ce833cf3ede15903c077 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 20 Dec 2024 13:32:46 +0000 Subject: [PATCH 01/26] run smoketests on mac --- .evergreen/buildvariants-and-tasks.in.yml | 24 +++--- .evergreen/buildvariants-and-tasks.yml | 16 ++++ .../compass-e2e-tests/installers/helpers.ts | 19 +++++ .../compass-e2e-tests/installers/mac-dmg.ts | 39 +++++++++ .../compass-e2e-tests/installers/types.ts | 9 +++ packages/compass-e2e-tests/smoke-test.ts | 81 ++++++++++++++++--- 6 files changed, 165 insertions(+), 23 deletions(-) create mode 100644 packages/compass-e2e-tests/installers/helpers.ts create mode 100644 packages/compass-e2e-tests/installers/mac-dmg.ts create mode 100644 packages/compass-e2e-tests/installers/types.ts diff --git a/.evergreen/buildvariants-and-tasks.in.yml b/.evergreen/buildvariants-and-tasks.in.yml index b9370851955..1ec21489680 100644 --- a/.evergreen/buildvariants-and-tasks.in.yml +++ b/.evergreen/buildvariants-and-tasks.in.yml @@ -80,18 +80,18 @@ const SMOKETEST_BUILD_VARIANTS = [ // run_on: 'rhel80-large', // depends_on: 'package-rhel', // }, -// { -// name: 'smoketest-macos-x64', -// display_name: 'Smoketest MacOS Intel', -// run_on: 'macos-14', -// depends_on: 'package-macos-x64', -// }, -// { -// name: 'smoketest-macos-arm', -// display_name: 'Smoketest MacOS Arm64', -// run_on: 'macos-14-arm64', -// depends_on: 'package-macos-arm', -// } + { + name: 'smoketest-macos-x64', + display_name: 'Smoketest MacOS Intel', + run_on: 'macos-14', + depends_on: 'package-macos-x64', + }, + { + name: 'smoketest-macos-arm', + display_name: 'Smoketest MacOS Arm64', + run_on: 'macos-14-arm64', + depends_on: 'package-macos-arm', + } ]; const TEST_PACKAGED_APP_BUILD_VARIANTS = [ diff --git a/.evergreen/buildvariants-and-tasks.yml b/.evergreen/buildvariants-and-tasks.yml index b5987af6c34..d0a40dec336 100644 --- a/.evergreen/buildvariants-and-tasks.yml +++ b/.evergreen/buildvariants-and-tasks.yml @@ -84,6 +84,22 @@ buildvariants: variant: package-ubuntu tasks: - name: smoketest-compass + - name: smoketest-macos-x64-compass + display_name: Smoketest MacOS Intel (compass) + run_on: macos-14 + depends_on: + - name: package-compass + variant: package-macos-x64 + tasks: + - name: smoketest-compass + - name: smoketest-macos-arm-compass + display_name: Smoketest MacOS Arm64 (compass) + run_on: macos-14-arm64 + depends_on: + - name: package-compass + variant: package-macos-arm + tasks: + - name: smoketest-compass - name: test-eol-servers display_name: Test EoL Servers run_on: ubuntu1804-large diff --git a/packages/compass-e2e-tests/installers/helpers.ts b/packages/compass-e2e-tests/installers/helpers.ts new file mode 100644 index 00000000000..9e0b6895661 --- /dev/null +++ b/packages/compass-e2e-tests/installers/helpers.ts @@ -0,0 +1,19 @@ +import type { SpawnSyncReturns } from 'child_process'; + +export function assertSpawnSyncResult( + result: SpawnSyncReturns, + name: string +) { + if (result.status === null) { + if (result.signal !== null) { + throw new Error(`${name} terminated due to signal ${result.signal}`); + } + + // not supposed to be possible to get here, but just in case + throw new Error(`${name} terminated with no status or signal`); + } + + if (result.status !== 0) { + throw new Error(`${name} failed with exit code ${result.status}`); + } +} diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts new file mode 100644 index 00000000000..7da9ac1be91 --- /dev/null +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -0,0 +1,39 @@ +import { existsSync } from 'fs'; +import { assertSpawnSyncResult } from './helpers'; +import type { InstalledAppInfo, Package } from './types'; +import { spawnSync } from 'child_process'; + +function exec(command: string, args: string[]) { + console.log(command, ...args); + + assertSpawnSyncResult( + spawnSync(command, args, { + encoding: 'utf8', + stdio: 'inherit', + }), + `${command} ${args.join(' ')}` + ); +} + +export async function installMacDMG( + appName: string, + { filepath }: Package +): Promise { + const fullDestinationPath = `/Applications/${appName}.app`; + + if (existsSync(fullDestinationPath)) { + throw new Error(`${fullDestinationPath} already exists`); + } + + exec('hdiutil', ['attach', filepath]); + try { + exec('cp', ['-r', `/Volumes/${appName}/${appName}.app`, '/Applications']); + } finally { + exec('hdiutil', ['detach', `/Volumes/${appName}`]); + } + + return Promise.resolve({ + appName, + appPath: `/Applications/${appName}.app`, + }); +} diff --git a/packages/compass-e2e-tests/installers/types.ts b/packages/compass-e2e-tests/installers/types.ts new file mode 100644 index 00000000000..70855624aa3 --- /dev/null +++ b/packages/compass-e2e-tests/installers/types.ts @@ -0,0 +1,9 @@ +export type Package = { + filename: string; + filepath: string; +}; + +export type InstalledAppInfo = { + appName: string; + appPath: string; +}; diff --git a/packages/compass-e2e-tests/smoke-test.ts b/packages/compass-e2e-tests/smoke-test.ts index 67a9cd2de64..2417f0731e9 100755 --- a/packages/compass-e2e-tests/smoke-test.ts +++ b/packages/compass-e2e-tests/smoke-test.ts @@ -1,4 +1,5 @@ #!/usr/bin/env npx ts-node +import { spawnSync } from 'child_process'; import { createWriteStream, existsSync, promises as fs } from 'fs'; import path from 'path'; import yargs from 'yargs'; @@ -7,6 +8,9 @@ import { hideBin } from 'yargs/helpers'; import https from 'https'; import { pick } from 'lodash'; import { handler as writeBuildInfo } from 'hadron-build/commands/info'; +import type { InstalledAppInfo, Package } from './installers/types'; +import { installMacDMG } from './installers/mac-dmg'; +import { assertSpawnSyncResult } from './installers/helpers'; const argv = yargs(hideBin(process.argv)) .scriptName('smoke-tests') @@ -137,6 +141,10 @@ async function run() { writeBuildInfo(infoArgs); const buildInfo = JSON.parse(await fs.readFile(infoArgs.out, 'utf8')); + if (!buildInfoIsCommon(buildInfo)) { + throw new Error('buildInfo is missing'); + } + // filter the extensions given the platform (isWindows, isOSX, isUbuntu, isRHEL) and extension const { isWindows, isOSX, isRHEL, isUbuntu, extension } = context; @@ -150,9 +158,9 @@ async function run() { if (!context.skipDownload) { await Promise.all( - packages.map(async ({ name, filepath }) => { + packages.map(async ({ filename, filepath }) => { await fs.mkdir(path.dirname(filepath), { recursive: true }); - const url = `https://${context.bucketName}.s3.amazonaws.com/${context.bucketKeyPrefix}/${name}`; + const url = `https://${context.bucketName}.s3.amazonaws.com/${context.bucketKeyPrefix}/${filename}`; console.log(url); return downloadFile(url, filepath); }) @@ -162,6 +170,24 @@ async function run() { verifyPackagesExist(packages); // TODO(COMPASS-8533): extract or install each package and then test the Compass binary + for (const pkg of packages) { + let appInfo: InstalledAppInfo | undefined = undefined; + + console.log('installing', pkg.filepath); + + if (pkg.filename.endsWith('.dmg')) { + appInfo = await installMacDMG(buildInfo.productName, pkg); + } + + // TODO: all the other installers go here + + if (appInfo) { + console.log('testing', appInfo.appPath); + testInstalledApp(appInfo); + } else { + console.log(`no app got installed for ${pkg.filename}`); + } + } } function platformFromContext( @@ -189,6 +215,18 @@ type PackageFilterConfig = Pick< // subsets of the hadron-build info result +const commonKeys = ['productName']; +type CommonBuildInfo = Record; + +function buildInfoIsCommon(buildInfo: any): buildInfo is CommonBuildInfo { + for (const key of commonKeys) { + if (!buildInfo[key]) { + return false; + } + } + return true; +} + const windowsFilenameKeys = [ 'windows_setup_filename', 'windows_msi_filename', @@ -245,11 +283,6 @@ function buildInfoIsRHEL(buildInfo: any): buildInfo is RHELBuildInfo { return true; } -type Package = { - name: string; - filepath: string; -}; - function getFilteredPackages( compassDir: string, buildInfo: any, @@ -282,11 +315,11 @@ function getFilteredPackages( const extension = config.extension; return names - .filter((name) => !extension || name.endsWith(extension)) - .map((name) => { + .filter((filename) => !extension || filename.endsWith(extension)) + .map((filename) => { return { - name, - filepath: path.join(compassDir, 'dist', name), + filename, + filepath: path.join(compassDir, 'dist', filename), }; }); } @@ -333,6 +366,32 @@ function verifyPackagesExist(packages: Package[]): void { } } +function testInstalledApp(appInfo: InstalledAppInfo) { + const result = spawnSync( + 'npm', + [ + 'run', + '--unsafe-perm', + 'test-packaged', + '--workspace', + 'compass-e2e-tests', + '--', + '--test-filter=time-to-first-query', + ], + { + encoding: 'utf8', + stdio: 'inherit', + env: { + ...process.env, + COMPASS_APP_NAME: appInfo.appName, + COMPASS_APP_PATH: appInfo.appPath, + }, + } + ); + + assertSpawnSyncResult(result, 'npm run test-packaged'); +} + run() .then(function () { console.log('done'); From 2f290759f764246e7dee4c5cff39484899631541 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 10:17:52 +0000 Subject: [PATCH 02/26] promisified async spawn helper rather --- .../compass-e2e-tests/installers/helpers.ts | 59 +++++++++++++------ .../compass-e2e-tests/installers/mac-dmg.ts | 25 +++----- packages/compass-e2e-tests/smoke-test.ts | 13 ++-- 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/packages/compass-e2e-tests/installers/helpers.ts b/packages/compass-e2e-tests/installers/helpers.ts index 9e0b6895661..f4ee6d65db6 100644 --- a/packages/compass-e2e-tests/installers/helpers.ts +++ b/packages/compass-e2e-tests/installers/helpers.ts @@ -1,19 +1,44 @@ -import type { SpawnSyncReturns } from 'child_process'; +import { spawn } from 'child_process'; +import type { SpawnOptions } from 'child_process'; -export function assertSpawnSyncResult( - result: SpawnSyncReturns, - name: string -) { - if (result.status === null) { - if (result.signal !== null) { - throw new Error(`${name} terminated due to signal ${result.signal}`); - } - - // not supposed to be possible to get here, but just in case - throw new Error(`${name} terminated with no status or signal`); - } - - if (result.status !== 0) { - throw new Error(`${name} failed with exit code ${result.status}`); - } +export function execute( + command: string, + args: string[], + options?: SpawnOptions +): Promise { + return new Promise((resolve, reject) => { + const p = spawn(command, args, { + stdio: 'inherit', + ...options, + }); + p.on('error', (err: any) => { + reject(err); + }); + p.on('close', (code: number | null, signal: NodeJS.Signals | null) => { + if (code !== null) { + if (code === 0) { + resolve(); + } else { + reject( + new Error(`${command} ${args.join(' ')} exited with code ${code}`) + ); + } + } else { + if (signal !== null) { + reject( + new Error( + `${command} ${args.join(' ')} exited with signal ${signal}` + ) + ); + } else { + // shouldn't happen + reject( + new Error( + `${command} ${args.join(' ')} exited with no code or signal` + ) + ); + } + } + }); + }); } diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 7da9ac1be91..3ea476c7aff 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -1,19 +1,6 @@ import { existsSync } from 'fs'; -import { assertSpawnSyncResult } from './helpers'; import type { InstalledAppInfo, Package } from './types'; -import { spawnSync } from 'child_process'; - -function exec(command: string, args: string[]) { - console.log(command, ...args); - - assertSpawnSyncResult( - spawnSync(command, args, { - encoding: 'utf8', - stdio: 'inherit', - }), - `${command} ${args.join(' ')}` - ); -} +import { execute } from './helpers'; export async function installMacDMG( appName: string, @@ -25,11 +12,15 @@ export async function installMacDMG( throw new Error(`${fullDestinationPath} already exists`); } - exec('hdiutil', ['attach', filepath]); + await execute('hdiutil', ['attach', filepath]); try { - exec('cp', ['-r', `/Volumes/${appName}/${appName}.app`, '/Applications']); + await execute('cp', [ + '-r', + `/Volumes/${appName}/${appName}.app`, + '/Applications', + ]); } finally { - exec('hdiutil', ['detach', `/Volumes/${appName}`]); + await execute('hdiutil', ['detach', `/Volumes/${appName}`]); } return Promise.resolve({ diff --git a/packages/compass-e2e-tests/smoke-test.ts b/packages/compass-e2e-tests/smoke-test.ts index 2417f0731e9..f7f4a5b2258 100755 --- a/packages/compass-e2e-tests/smoke-test.ts +++ b/packages/compass-e2e-tests/smoke-test.ts @@ -1,5 +1,4 @@ #!/usr/bin/env npx ts-node -import { spawnSync } from 'child_process'; import { createWriteStream, existsSync, promises as fs } from 'fs'; import path from 'path'; import yargs from 'yargs'; @@ -10,7 +9,7 @@ import { pick } from 'lodash'; import { handler as writeBuildInfo } from 'hadron-build/commands/info'; import type { InstalledAppInfo, Package } from './installers/types'; import { installMacDMG } from './installers/mac-dmg'; -import { assertSpawnSyncResult } from './installers/helpers'; +import { execute } from './installers/helpers'; const argv = yargs(hideBin(process.argv)) .scriptName('smoke-tests') @@ -183,7 +182,7 @@ async function run() { if (appInfo) { console.log('testing', appInfo.appPath); - testInstalledApp(appInfo); + await testInstalledApp(appInfo); } else { console.log(`no app got installed for ${pkg.filename}`); } @@ -366,8 +365,8 @@ function verifyPackagesExist(packages: Package[]): void { } } -function testInstalledApp(appInfo: InstalledAppInfo) { - const result = spawnSync( +function testInstalledApp(appInfo: InstalledAppInfo): Promise { + return execute( 'npm', [ 'run', @@ -379,8 +378,6 @@ function testInstalledApp(appInfo: InstalledAppInfo) { '--test-filter=time-to-first-query', ], { - encoding: 'utf8', - stdio: 'inherit', env: { ...process.env, COMPASS_APP_NAME: appInfo.appName, @@ -388,8 +385,6 @@ function testInstalledApp(appInfo: InstalledAppInfo) { }, } ); - - assertSpawnSyncResult(result, 'npm run test-packaged'); } run() From b0840a8e8a7bb0d800ea2e6a48bdc99be1069026 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 15:38:39 +0000 Subject: [PATCH 03/26] try and preserve permissions --- packages/compass-e2e-tests/installers/mac-dmg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 3ea476c7aff..b2ad41438bc 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -15,7 +15,7 @@ export async function installMacDMG( await execute('hdiutil', ['attach', filepath]); try { await execute('cp', [ - '-r', + '-Rp', `/Volumes/${appName}/${appName}.app`, '/Applications', ]); From 58fdaf5c49add3c5ab2c4d46ada8c55d0ba72ed4 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 15:41:44 +0000 Subject: [PATCH 04/26] print args --- packages/compass-e2e-tests/installers/helpers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/compass-e2e-tests/installers/helpers.ts b/packages/compass-e2e-tests/installers/helpers.ts index f4ee6d65db6..b1fb872f97d 100644 --- a/packages/compass-e2e-tests/installers/helpers.ts +++ b/packages/compass-e2e-tests/installers/helpers.ts @@ -7,6 +7,7 @@ export function execute( options?: SpawnOptions ): Promise { return new Promise((resolve, reject) => { + console.log(command, ...args); const p = spawn(command, args, { stdio: 'inherit', ...options, From 1222ccaa0437251136f5c327703953b49bba8424 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 15:51:58 +0000 Subject: [PATCH 05/26] print logs --- packages/compass-e2e-tests/smoke-test.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/compass-e2e-tests/smoke-test.ts b/packages/compass-e2e-tests/smoke-test.ts index f7f4a5b2258..2007b20c2fb 100755 --- a/packages/compass-e2e-tests/smoke-test.ts +++ b/packages/compass-e2e-tests/smoke-test.ts @@ -182,7 +182,15 @@ async function run() { if (appInfo) { console.log('testing', appInfo.appPath); - await testInstalledApp(appInfo); + try { + await testInstalledApp(appInfo); + } finally { + try { + await execute('cat', [`${__dirname}/.log/webdriver/*`]); + } catch (err) { + /* ignore*/ + } + } } else { console.log(`no app got installed for ${pkg.filename}`); } @@ -365,8 +373,8 @@ function verifyPackagesExist(packages: Package[]): void { } } -function testInstalledApp(appInfo: InstalledAppInfo): Promise { - return execute( +async function testInstalledApp(appInfo: InstalledAppInfo): Promise { + await execute( 'npm', [ 'run', From 258cdfa424bccb31025b3a3482cb50cb7533ff3d Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 20:36:38 +0000 Subject: [PATCH 06/26] nevermind --- packages/compass-e2e-tests/smoke-test.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/compass-e2e-tests/smoke-test.ts b/packages/compass-e2e-tests/smoke-test.ts index 2007b20c2fb..d6b18da3f89 100755 --- a/packages/compass-e2e-tests/smoke-test.ts +++ b/packages/compass-e2e-tests/smoke-test.ts @@ -182,15 +182,7 @@ async function run() { if (appInfo) { console.log('testing', appInfo.appPath); - try { - await testInstalledApp(appInfo); - } finally { - try { - await execute('cat', [`${__dirname}/.log/webdriver/*`]); - } catch (err) { - /* ignore*/ - } - } + await testInstalledApp(appInfo); } else { console.log(`no app got installed for ${pkg.filename}`); } From 71f9174a670141a8c4d526581ae36ebc1772b0a7 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 20:57:36 +0000 Subject: [PATCH 07/26] trying random things --- packages/compass-e2e-tests/installers/mac-dmg.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index b2ad41438bc..32fe5b25187 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -14,15 +14,19 @@ export async function installMacDMG( await execute('hdiutil', ['attach', filepath]); try { - await execute('cp', [ - '-Rp', - `/Volumes/${appName}/${appName}.app`, - '/Applications', - ]); + await execute( + 'cp', + ['-Rp', `/Volumes/${appName}/${appName}.app`, '/Applications'], + { shell: true } + ); } finally { await execute('hdiutil', ['detach', `/Volumes/${appName}`]); } + if (!existsSync(`/Applications/${appName}.app/Contents/MacOS/${appName}`)) { + throw new Error('app not found'); + } + return Promise.resolve({ appName, appPath: `/Applications/${appName}.app`, From 7b8acdbe9224ba8272f8b3b7364c200ae9f51d9e Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 23 Dec 2024 21:45:15 +0000 Subject: [PATCH 08/26] quotes --- packages/compass-e2e-tests/installers/mac-dmg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 32fe5b25187..1888aa03da7 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -16,7 +16,7 @@ export async function installMacDMG( try { await execute( 'cp', - ['-Rp', `/Volumes/${appName}/${appName}.app`, '/Applications'], + ['-Rp', `"/Volumes/${appName}/${appName}.app"`, '/Applications'], { shell: true } ); } finally { From ef9b20ab6c98009a328c09570c451f85c9d55535 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 10:15:07 +0000 Subject: [PATCH 09/26] recursuvely list contents after copying --- packages/compass-e2e-tests/installers/mac-dmg.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 1888aa03da7..ee7000cd36f 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -14,18 +14,16 @@ export async function installMacDMG( await execute('hdiutil', ['attach', filepath]); try { - await execute( - 'cp', - ['-Rp', `"/Volumes/${appName}/${appName}.app"`, '/Applications'], - { shell: true } - ); + await execute('cp', [ + '-Rp', + `/Volumes/${appName}/${appName}.app`, + '/Applications', + ]); } finally { await execute('hdiutil', ['detach', `/Volumes/${appName}`]); } - if (!existsSync(`/Applications/${appName}.app/Contents/MacOS/${appName}`)) { - throw new Error('app not found'); - } + await execute('ls', ['-laR', `/Applications/${appName}.app`]); return Promise.resolve({ appName, From 53d549b5f298219a13ac42749d847aa7c2830210 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 10:55:59 +0000 Subject: [PATCH 10/26] more fixes and debugging --- .evergreen/functions.yml | 2 +- .../compass-e2e-tests/installers/mac-dmg.ts | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.evergreen/functions.yml b/.evergreen/functions.yml index 245309cfac5..87690679e90 100644 --- a/.evergreen/functions.yml +++ b/.evergreen/functions.yml @@ -674,7 +674,7 @@ functions: export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true" fi - npm run --workspace compass-e2e-tests smoketest + npm run --unsafe-perm --workspace compass-e2e-tests smoketest test-web-sandbox: - command: shell.exec diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index ee7000cd36f..82b6a6dbd39 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -1,4 +1,5 @@ -import { existsSync } from 'fs'; +import path from 'path'; +import { existsSync, promises as fs } from 'fs'; import type { InstalledAppInfo, Package } from './types'; import { execute } from './helpers'; @@ -23,8 +24,26 @@ export async function installMacDMG( await execute('hdiutil', ['detach', `/Volumes/${appName}`]); } + // get debug output so we can see that it copied everything with the correct + // permissions await execute('ls', ['-laR', `/Applications/${appName}.app`]); + // see if the executable will run without being quarantined or similar + await execute(`/Applications/${appName}.app/Contents/MacOS/${appName}`, [ + '--version', + ]); + + // see if the GUI works + const logPath = path.resolve(__dirname, '..', '.log'); + await fs.mkdir(logPath); + const screenshotPath = path.resolve( + __dirname, + '..', + '.log', + 'screenshot.png' + ); + await execute(`screencapture`, [screenshotPath]); + return Promise.resolve({ appName, appPath: `/Applications/${appName}.app`, From a0934c6177b491f9f10b0b6d4caccf537b81b5bb Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 11:05:21 +0000 Subject: [PATCH 11/26] don't fail if the dir exists --- packages/compass-e2e-tests/installers/mac-dmg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 82b6a6dbd39..e42e5b72783 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -35,7 +35,7 @@ export async function installMacDMG( // see if the GUI works const logPath = path.resolve(__dirname, '..', '.log'); - await fs.mkdir(logPath); + await fs.mkdir(logPath, { recursive: true }); const screenshotPath = path.resolve( __dirname, '..', From 1c775020907900bb4f4b2fa581f65317641bf077 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 11:48:48 +0000 Subject: [PATCH 12/26] the app might already exist --- packages/compass-e2e-tests/installers/mac-dmg.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index e42e5b72783..87c9114e09e 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -10,7 +10,10 @@ export async function installMacDMG( const fullDestinationPath = `/Applications/${appName}.app`; if (existsSync(fullDestinationPath)) { - throw new Error(`${fullDestinationPath} already exists`); + // Would ideally just throw here, but unfortunately in CI the mac + // environments aren't all clean so somewhere we have to remove it anyway. + console.log(`${fullDestinationPath} already exists. Removing.`); + await execute('rm', ['-rf', fullDestinationPath]); } await execute('hdiutil', ['attach', filepath]); From 27dc5c67e58990e4acf79f80eb78618881022628 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 12:26:13 +0000 Subject: [PATCH 13/26] screencapture is not working --- packages/compass-e2e-tests/installers/mac-dmg.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 87c9114e09e..99f6c40b5d6 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -36,17 +36,6 @@ export async function installMacDMG( '--version', ]); - // see if the GUI works - const logPath = path.resolve(__dirname, '..', '.log'); - await fs.mkdir(logPath, { recursive: true }); - const screenshotPath = path.resolve( - __dirname, - '..', - '.log', - 'screenshot.png' - ); - await execute(`screencapture`, [screenshotPath]); - return Promise.resolve({ appName, appPath: `/Applications/${appName}.app`, From c85a44e5b8c92a49eae759415207181f6fd64703 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 12:37:21 +0000 Subject: [PATCH 14/26] unused imports --- packages/compass-e2e-tests/installers/mac-dmg.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 99f6c40b5d6..c3345bbd4cf 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -1,5 +1,4 @@ -import path from 'path'; -import { existsSync, promises as fs } from 'fs'; +import { existsSync } from 'fs'; import type { InstalledAppInfo, Package } from './types'; import { execute } from './helpers'; From 03d6a762fda1518a8a54a43c6129a89121793c77 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 14:16:34 +0000 Subject: [PATCH 15/26] info level logging for now --- packages/compass-e2e-tests/helpers/compass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/compass.ts b/packages/compass-e2e-tests/helpers/compass.ts index 317823b09d0..f31b636974b 100644 --- a/packages/compass-e2e-tests/helpers/compass.ts +++ b/packages/compass-e2e-tests/helpers/compass.ts @@ -547,7 +547,7 @@ async function processCommonOpts({ // https://webdriver.io/docs/options/#webdriver-options const webdriverOptions = { - logLevel: 'warn' as const, // info is super verbose right now + logLevel: 'info' as const, // info is super verbose right now outputDir: webdriverLogPath, }; From 60b0a29235f1b240c352d6478546ee4495c2c365 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 14:19:51 +0000 Subject: [PATCH 16/26] even more debugging --- packages/compass-e2e-tests/helpers/compass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/compass.ts b/packages/compass-e2e-tests/helpers/compass.ts index f31b636974b..c3580bf6781 100644 --- a/packages/compass-e2e-tests/helpers/compass.ts +++ b/packages/compass-e2e-tests/helpers/compass.ts @@ -547,7 +547,7 @@ async function processCommonOpts({ // https://webdriver.io/docs/options/#webdriver-options const webdriverOptions = { - logLevel: 'info' as const, // info is super verbose right now + logLevel: 'trace' as const, outputDir: webdriverLogPath, }; From abb96746d201e6b21495b1a40b26251d5c01ddb8 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 15:20:19 +0000 Subject: [PATCH 17/26] really enable chromedriver's verbose logging --- packages/compass-e2e-tests/helpers/compass.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/compass-e2e-tests/helpers/compass.ts b/packages/compass-e2e-tests/helpers/compass.ts index c3580bf6781..3ba2e5e181c 100644 --- a/packages/compass-e2e-tests/helpers/compass.ts +++ b/packages/compass-e2e-tests/helpers/compass.ts @@ -643,9 +643,10 @@ async function startCompassElectron( }, // from https://github.com/webdriverio-community/wdio-electron-service/blob/32457f60382cb4970c37c7f0a19f2907aaa32443/packages/wdio-electron-service/src/launcher.ts#L102 'wdio:enforceWebDriverClassic': true, - }, - 'wdio:chromedriverOptions': { - // TODO: enable logging so we don't have to debug things blindly + 'wdio:chromedriverOptions': { + // enable logging so we don't have to debug things blindly + verbose: true, + }, }, ...webdriverOptions, ...wdioOptions, @@ -657,7 +658,10 @@ async function startCompassElectron( let browser: CompassBrowser; try { - browser = (await remote(options)) as CompassBrowser; + // webdriverio's type is wrong for + // options.capabilities['wdio:chromedriverOptions'] and it doesn't allow + // verbose even though it does work + browser = (await remote(options as any)) as CompassBrowser; } catch (err) { debug('Failed to start remote webdriver session', { error: (err as Error).stack, From 1e24a08e786719d0bdc58204297cf0f9234a18b2 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 16:25:06 +0000 Subject: [PATCH 18/26] MOAR log output --- packages/compass-e2e-tests/helpers/compass.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/compass.ts b/packages/compass-e2e-tests/helpers/compass.ts index 3ba2e5e181c..7a9912de96f 100644 --- a/packages/compass-e2e-tests/helpers/compass.ts +++ b/packages/compass-e2e-tests/helpers/compass.ts @@ -601,7 +601,9 @@ async function startCompassElectron( // See https://www.electronjs.org/docs/latest/api/command-line-switches#--enable-loggingfile '--enable-logging=file', // See https://www.electronjs.org/docs/latest/api/command-line-switches#--log-filepath - `--log-file=${electronLogFile}` + `--log-file=${electronLogFile}`, + // See // https://chromium.googlesource.com/chromium/src/+/master/docs/chrome_os_logging.md + '--log-level=0' ); if (opts.extraSpawnArgs) { From 81ad1dd384d22b7574b1170d5be67aae4a8cd1e3 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Tue, 24 Dec 2024 16:25:14 +0000 Subject: [PATCH 19/26] does running compass crash? --- packages/compass-e2e-tests/installers/mac-dmg.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index c3345bbd4cf..222b3e4f916 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -35,6 +35,9 @@ export async function installMacDMG( '--version', ]); + // by my calculations this should crash + await execute(`/Applications/${appName}.app/Contents/MacOS/${appName}`, []); + return Promise.resolve({ appName, appPath: `/Applications/${appName}.app`, From 6809cf9d082b4fd1422a258ef636c2d2bbe0b046 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 26 Dec 2024 15:44:24 +0000 Subject: [PATCH 20/26] remove settings dir before starting --- packages/compass-e2e-tests/installers/mac-dmg.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 222b3e4f916..238a2b701e4 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -1,3 +1,4 @@ +import path from 'path'; import { existsSync } from 'fs'; import type { InstalledAppInfo, Package } from './types'; import { execute } from './helpers'; @@ -35,8 +36,19 @@ export async function installMacDMG( '--version', ]); - // by my calculations this should crash - await execute(`/Applications/${appName}.app/Contents/MacOS/${appName}`, []); + if (process.env.HOME) { + const settingsDir = path.resolve( + process.env.HOME, + 'Library', + 'Application Support', + appName + ); + + if (existsSync(settingsDir)) { + console.log(`${settingsDir} already exists. Removing.`); + await execute('rm', ['-rf', settingsDir]); + } + } return Promise.resolve({ appName, From a1db900bc8f8dbb79c9abbba7a113cf699351e8c Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Thu, 26 Dec 2024 18:46:04 +0000 Subject: [PATCH 21/26] list app support dir --- packages/compass-e2e-tests/installers/mac-dmg.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 238a2b701e4..48765c6c8ac 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -48,6 +48,13 @@ export async function installMacDMG( console.log(`${settingsDir} already exists. Removing.`); await execute('rm', ['-rf', settingsDir]); } + + const appSupportDir = path.resolve( + process.env.HOME, + 'Library', + 'Application Support' + ); + await execute('ls', ['-la', appSupportDir]); } return Promise.resolve({ From b19bbbd2333f98f7b22a6ae40ad295fcb5b7ca5f Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 27 Dec 2024 10:57:44 +0000 Subject: [PATCH 22/26] comment for clarification --- packages/compass-e2e-tests/helpers/chrome-startup-flags.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/compass-e2e-tests/helpers/chrome-startup-flags.ts b/packages/compass-e2e-tests/helpers/chrome-startup-flags.ts index fb0fc4d3733..fc7ac6dc1b6 100644 --- a/packages/compass-e2e-tests/helpers/chrome-startup-flags.ts +++ b/packages/compass-e2e-tests/helpers/chrome-startup-flags.ts @@ -1,5 +1,6 @@ // Copied from https://github.com/webdriverio/webdriverio/blob/1825c633aead82bc650dff1f403ac30cff7c7cb3/packages/devtools/src/constants.ts // These are the default flags that webdriverio uses to start Chrome driver. +// NOTE: this has since been removed along with the devtools automation protocol https://github.com/webdriverio/webdriverio/commit/28e64e439ffc36a95f24aeda9f1d21111429dfa3#diff-6ea151d6c0687197931735239f397b7f5f0140a588c5b2b82ff584bbe73be069 const DEFAULT_WEBDRIVER_FLAGS = [ // suppresses Save Password prompt window '--enable-automation', From b31073f877f00f917c7673e2092f86b7a307cc3d Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 27 Dec 2024 11:10:08 +0000 Subject: [PATCH 23/26] trace output to see where it gets --- packages/compass-e2e-tests/installers/mac-dmg.ts | 7 ------- packages/compass/src/main/index.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 48765c6c8ac..238a2b701e4 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -48,13 +48,6 @@ export async function installMacDMG( console.log(`${settingsDir} already exists. Removing.`); await execute('rm', ['-rf', settingsDir]); } - - const appSupportDir = path.resolve( - process.env.HOME, - 'Library', - 'Application Support' - ); - await execute('ls', ['-la', appSupportDir]); } return Promise.resolve({ diff --git a/packages/compass/src/main/index.ts b/packages/compass/src/main/index.ts index 474b75a0c22..df720f28605 100644 --- a/packages/compass/src/main/index.ts +++ b/packages/compass/src/main/index.ts @@ -51,6 +51,13 @@ async function main(): Promise { ...globalPreferences.hardcoded, }; const preferenceParseErrorsString = preferenceParseErrors.join('\n'); + + process.stdout.write( + `combined preferences: ${JSON.stringify( + preferences + )}, preferenceParseErrorsString: ${preferenceParseErrorsString}\n` + ); + if (preferences.version) { process.stdout.write(`${app.getName()} ${app.getVersion()}\n`); return app.exit(0); @@ -85,6 +92,8 @@ async function main(): Promise { trackingProps: { context: 'CLI' }, }; + process.stdout.write(`importing CompassApplication\n`); + const { CompassApplication } = await import('./application'); const doImportExport = @@ -124,6 +133,8 @@ async function main(): Promise { }); } + process.stdout.write(`Starting CompassApplication ${mode}\n`); + try { await CompassApplication.init(mode, globalPreferences); } catch (e) { @@ -138,6 +149,8 @@ async function main(): Promise { return; } + process.stdout.write(`Done starting CompassApplication ${mode}\n`); + if (mode === 'CLI') { let exitCode = 0; try { From 9401c558311637b1cacd416bdf424742e707fcf7 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 27 Dec 2024 12:02:31 +0000 Subject: [PATCH 24/26] more logging --- packages/compass/src/main/application.ts | 12 ++++++++++++ packages/compass/src/main/index.ts | 3 +++ 2 files changed, 15 insertions(+) diff --git a/packages/compass/src/main/application.ts b/packages/compass/src/main/application.ts index be6e8e8e605..5d6b64ea106 100644 --- a/packages/compass/src/main/application.ts +++ b/packages/compass/src/main/application.ts @@ -106,29 +106,38 @@ class CompassApplication { safeStorage.setUsePlainTextEncryption(true); } + process.stdout.write('before setupPreferencesAndUser\n'); const { preferences } = await setupPreferencesAndUser( globalPreferences, safeStorage ); + process.stdout.write('after setupPreferencesAndUser\n'); this.preferences = preferences; await this.setupLogging(); + process.stdout.write('after setupLogging\n'); await this.setupProxySupport(app, 'Application'); + process.stdout.write('after setupProxySupport\n'); // need to happen after setupPreferencesAndUser and setupProxySupport await this.setupTelemetry(); + process.stdout.write('after setupTelemetry\n'); await setupProtocolHandlers( process.argv.includes('--squirrel-uninstall') ? 'uninstall' : 'install', this.preferences ); + process.stdout.write('after setupProtocolHandlers\n'); // needs to happen after setupProtocolHandlers if ((await import('electron-squirrel-startup')).default) { debug('electron-squirrel-startup event handled sucessfully\n'); return; } + process.stdout.write('after electron-squirrel-startup\n'); // Accessing isEncryptionAvailable is not allowed when app is not ready on Windows // https://github.com/electron/electron/issues/33640 await app.whenReady(); + + process.stdout.write('after app.whenReady\n'); log.info( mongoLogId(1_001_000_307), 'Application', @@ -153,12 +162,14 @@ class CompassApplication { { message: (e as Error).message } ); } + process.stdout.write('after connectionStorage.migrateToSafeStorage\n'); if (mode === 'CLI') { return; } await this.setupCORSBypass(); + process.stdout.write('after setupCORSBypass\n'); void this.setupCompassAuthService(); // TODO(COMPASS-7618): For now don't setup auto-update in CI because the // toasts will obscure other things which we don't expect yet. @@ -166,6 +177,7 @@ class CompassApplication { this.setupAutoUpdate(); } await setupCSFLELibrary(); + process.stdout.write('after setupCSFLELibrary\n'); setupTheme(this); this.setupJavaScriptArguments(); this.setupLifecycleListeners(); diff --git a/packages/compass/src/main/index.ts b/packages/compass/src/main/index.ts index df720f28605..6078a5c4565 100644 --- a/packages/compass/src/main/index.ts +++ b/packages/compass/src/main/index.ts @@ -138,6 +138,9 @@ async function main(): Promise { try { await CompassApplication.init(mode, globalPreferences); } catch (e) { + process.stdout.write( + `Error during CompassApplication.init ${(e as any)?.message ?? ''}\n` + ); if (mode === 'CLI') { process.stderr.write('Exiting due to try/catch:\n'); // eslint-disable-next-line no-console From ba4f8b329c3bc7b3e1c8653504e806257ec48455 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 27 Dec 2024 14:00:26 +0000 Subject: [PATCH 25/26] more granular and don't do anything before the app is ready --- packages/compass/src/main/application.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/compass/src/main/application.ts b/packages/compass/src/main/application.ts index 5d6b64ea106..f341aea4f9a 100644 --- a/packages/compass/src/main/application.ts +++ b/packages/compass/src/main/application.ts @@ -106,6 +106,10 @@ class CompassApplication { safeStorage.setUsePlainTextEncryption(true); } + process.stdout.write('before first app.whenReady\n'); + await app.whenReady(); + process.stdout.write('after first app.whenReady\n'); + process.stdout.write('before setupPreferencesAndUser\n'); const { preferences } = await setupPreferencesAndUser( globalPreferences, @@ -194,7 +198,12 @@ class CompassApplication { } private static async setupCompassAuthService() { - await CompassAuthService.init(this.preferences, this.httpClient); + try { + await CompassAuthService.init(this.preferences, this.httpClient); + } catch (err: any) { + process.stdout.write('Got CompassAuthService.init error\n'); + throw err; + } this.addExitHandler(() => { return CompassAuthService.onExit(); }); @@ -310,14 +319,18 @@ class CompassApplication { logContext: string ): Promise<() => void> { const onChange = async (value: string) => { + process.stdout.write('setupProxySupport onChange\n'); try { const proxyOptions = proxyPreferenceToProxyOptions(value); await app.whenReady(); + process.stdout.write('after setupProxySupport app.whenReady\n'); + try { const electronProxyConfig = translateToElectronProxyConfig(proxyOptions); await target.setProxy(electronProxyConfig); + process.stdout.write('after setupProxySupport target.setProxy\n'); } catch (err) { const headline = String( err && typeof err === 'object' && 'message' in err @@ -335,6 +348,7 @@ class CompassApplication { } ); await target.setProxy({}); + process.stdout.write('after setupProxySupport target.setProxy({})\n'); } const agent = createAgent(proxyOptions); @@ -361,6 +375,9 @@ class CompassApplication { ), } ); + process.stdout.write( + 'after setupProxySupport Unable to set proxy configuration\n' + ); } }; const unsubscribe = this.preferences.onPreferenceValueChanged( From 194fd6a842f22df10d4a1bec58f59fb3f5aeea06 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 27 Dec 2024 14:57:03 +0000 Subject: [PATCH 26/26] wait for ready before doing anything --- packages/compass/src/main/application.ts | 4 ---- packages/compass/src/main/index.ts | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/compass/src/main/application.ts b/packages/compass/src/main/application.ts index f341aea4f9a..8cccea7a651 100644 --- a/packages/compass/src/main/application.ts +++ b/packages/compass/src/main/application.ts @@ -106,10 +106,6 @@ class CompassApplication { safeStorage.setUsePlainTextEncryption(true); } - process.stdout.write('before first app.whenReady\n'); - await app.whenReady(); - process.stdout.write('after first app.whenReady\n'); - process.stdout.write('before setupPreferencesAndUser\n'); const { preferences } = await setupPreferencesAndUser( globalPreferences, diff --git a/packages/compass/src/main/index.ts b/packages/compass/src/main/index.ts index 6078a5c4565..6d6484c4ac8 100644 --- a/packages/compass/src/main/index.ts +++ b/packages/compass/src/main/index.ts @@ -29,6 +29,10 @@ process.title = app.getName(); void main(); async function main(): Promise { + process.stdout.write('before first app.whenReady\n'); + await app.whenReady(); + process.stdout.write('after first app.whenReady\n'); + const globalPreferences = await parseAndValidateGlobalPreferences(); // These are expected to go away at some point.