From 1dd3ac805eac5306781a3d75ad4acb82a0997354 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 10 Jan 2025 13:52:03 +0000 Subject: [PATCH 01/10] refactor smoke-test.ts structure --- .evergreen/buildvariants-and-tasks.in.yml | 12 +- .evergreen/buildvariants-and-tasks.yml | 8 - .evergreen/functions.yml | 19 +- .../compass-e2e-tests/helpers/buildinfo.ts | 76 ++++ .../compass-e2e-tests/installers/mac-dmg.ts | 15 +- .../compass-e2e-tests/installers/types.ts | 14 +- packages/compass-e2e-tests/smoke-test.ts | 366 +++++++----------- 7 files changed, 258 insertions(+), 252 deletions(-) create mode 100644 packages/compass-e2e-tests/helpers/buildinfo.ts diff --git a/.evergreen/buildvariants-and-tasks.in.yml b/.evergreen/buildvariants-and-tasks.in.yml index 2659cf057fc..7a6294b598c 100644 --- a/.evergreen/buildvariants-and-tasks.in.yml +++ b/.evergreen/buildvariants-and-tasks.in.yml @@ -61,12 +61,12 @@ const PACKAGE_BUILD_VARIANTS = [ ]; const SMOKETEST_BUILD_VARIANTS = [ - { - name: 'smoketest-ubuntu', - display_name: 'Smoketest Ubuntu', - run_on: 'ubuntu2004-large', - depends_on: 'package-ubuntu', - }, +// { +// name: 'smoketest-ubuntu', +// display_name: 'Smoketest Ubuntu', +// run_on: 'ubuntu2004-large', +// depends_on: 'package-ubuntu', +// }, // { // name: 'smoketest-windows', diff --git a/.evergreen/buildvariants-and-tasks.yml b/.evergreen/buildvariants-and-tasks.yml index 3c79e271bf0..2593d9c29f5 100644 --- a/.evergreen/buildvariants-and-tasks.yml +++ b/.evergreen/buildvariants-and-tasks.yml @@ -76,14 +76,6 @@ buildvariants: - name: package-compass - name: package-compass-isolated - name: package-compass-readonly - - name: smoketest-ubuntu-compass - display_name: Smoketest Ubuntu (compass) - run_on: ubuntu2004-large - depends_on: - - name: package-compass - variant: package-ubuntu - tasks: - - name: smoketest-compass - name: smoketest-macos-x64-compass display_name: Smoketest MacOS Intel (compass) run_on: macos-14-gui diff --git a/.evergreen/functions.yml b/.evergreen/functions.yml index 87690679e90..c1ba6070806 100644 --- a/.evergreen/functions.yml +++ b/.evergreen/functions.yml @@ -669,12 +669,29 @@ functions: # Load environment variables eval $(.evergreen/print-compass-env.sh) + if [[ "$IS_WINDOWS" == "true" ]]; then + // TODO: windows_setup + // TODO: windows_msi + // TODO: windows_zip + fi + if [[ "$IS_OSX" == "true" ]]; then echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)" export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true" + npm run --unsafe-perm --workspace compass-e2e-tests smoketest -- --package=osx_dmg + // TODO: osx_zip + fi + + if [[ "$IS_UBUNTU" == "true" ]]; then + // TODO: linux_deb + // TODO: linux_tar + fi + + if [[ "$IS_RHEL" == "true" ]]; then + // TODO: linux_rpm + // TODO: rhel_tar fi - npm run --unsafe-perm --workspace compass-e2e-tests smoketest test-web-sandbox: - command: shell.exec diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts new file mode 100644 index 00000000000..7fbd8ae9891 --- /dev/null +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -0,0 +1,76 @@ +import assert from 'node:assert/strict'; + +// subsets of the hadron-build info result + +const commonKeys = ['productName']; +type CommonBuildInfo = Record; + +function assertObjectHasKeys(obj: any, name: string, keys: readonly string[]) { + assert( + typeof obj === 'object' && obj !== null, + 'Expected buildInfo to be an object' + ); + + for (const key of keys) { + assert(key in obj, `Expected '${name}' to have '${key}'`); + } +} + +export function assertCommonBuildInfo( + buildInfo: unknown +): asserts buildInfo is CommonBuildInfo { + assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); +} + +const windowsFilenameKeys = [ + 'windows_setup_filename', + 'windows_msi_filename', + 'windows_zip_filename', + 'windows_nupkg_full_filename', +] as const; +type WindowsBuildInfo = CommonBuildInfo & + Record; + +const osxFilenameKeys = ['osx_dmg_filename', 'osx_zip_filename'] as const; +type OSXBuildInfo = CommonBuildInfo & + Record; + +const ubuntuFilenameKeys = [ + 'linux_deb_filename', + 'linux_tar_filename', +] as const; +type UbuntuBuildInfo = CommonBuildInfo & + Record; + +const rhelFilenameKeys = ['linux_rpm_filename', 'rhel_tar_filename'] as const; +type RHELBuildInfo = CommonBuildInfo & + Record; + +export function assertBuildInfoIsWindows( + buildInfo: any +): asserts buildInfo is WindowsBuildInfo { + assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); + assertObjectHasKeys(buildInfo, 'buildInfo', windowsFilenameKeys); +} + +export function assertBuildInfoIsOSX( + buildInfo: any +): asserts buildInfo is OSXBuildInfo { + assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); + assertObjectHasKeys(buildInfo, 'buildInfo', osxFilenameKeys); +} + +export function assertBuildInfoIsUbuntu( + buildInfo: any +): buildInfo is UbuntuBuildInfo { + assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); + assertObjectHasKeys(buildInfo, 'buildInfo', ubuntuFilenameKeys); + return true; +} + +export function assertBuildInfoIsRHEL( + buildInfo: any +): asserts buildInfo is RHELBuildInfo { + assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); + assertObjectHasKeys(buildInfo, 'buildInfo', rhelFilenameKeys); +} diff --git a/packages/compass-e2e-tests/installers/mac-dmg.ts b/packages/compass-e2e-tests/installers/mac-dmg.ts index 25883dcc598..961ab2598ae 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -1,12 +1,13 @@ import path from 'path'; import { existsSync } from 'fs'; -import type { InstalledAppInfo, Package } from './types'; +import type { InstalledAppInfo, InstallablePackage } from './types'; import { execute } from './helpers'; -export async function installMacDMG( - appName: string, - { filepath }: Package -): Promise { +export async function installMacDMG({ + appName, + filepath, +}: InstallablePackage): Promise { + // TODO: rather copy this to a temporary directory const fullDestinationPath = `/Applications/${appName}.app`; if (existsSync(fullDestinationPath)) { @@ -47,7 +48,9 @@ export async function installMacDMG( } return Promise.resolve({ - appName, appPath: `/Applications/${appName}.app`, + uninstall: async function () { + /* TODO */ + }, }); } diff --git a/packages/compass-e2e-tests/installers/types.ts b/packages/compass-e2e-tests/installers/types.ts index 70855624aa3..ec263474202 100644 --- a/packages/compass-e2e-tests/installers/types.ts +++ b/packages/compass-e2e-tests/installers/types.ts @@ -1,9 +1,19 @@ +export type Installer = (pkg: InstallablePackage) => Promise; + export type Package = { - filename: string; + appName: string; + packageFilepath: string; + // TODO: once we can download the most recent release + //releaseFilepath: string; + installer: Installer; +}; + +export type InstallablePackage = { + appName: string; filepath: string; }; export type InstalledAppInfo = { - appName: string; appPath: string; + uninstall: () => Promise; }; diff --git a/packages/compass-e2e-tests/smoke-test.ts b/packages/compass-e2e-tests/smoke-test.ts index 6e73f354a28..c8689507c09 100755 --- a/packages/compass-e2e-tests/smoke-test.ts +++ b/packages/compass-e2e-tests/smoke-test.ts @@ -8,9 +8,16 @@ 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 type { InstalledAppInfo, Package, Installer } from './installers/types'; import { installMacDMG } from './installers/mac-dmg'; import { execute } from './installers/helpers'; +import { + assertBuildInfoIsOSX, + assertBuildInfoIsRHEL, + assertBuildInfoIsUbuntu, + assertBuildInfoIsWindows, + assertCommonBuildInfo, +} from './helpers/buildinfo'; const argv = yargs(hideBin(process.argv)) .scriptName('smoke-tests') @@ -25,28 +32,20 @@ const argv = yargs(hideBin(process.argv)) type: 'string', default: process.env.EVERGREEN_BUCKET_KEY_PREFIX, }) - .option('devVersion', { + .option('version', { type: 'string', // For dev versions we need this from evergreen. For beta or stable (or by // default, ie. when testing a locally packaged app) we get it from the // package.json default: process.env.DEV_VERSION_IDENTIFIER, + description: + 'Will be read from packages/compass/package.json if not specified', }) - .option('isWindows', { - type: 'boolean', - default: process.env.IS_WINDOWS === 'true', - }) - .option('isOSX', { - type: 'boolean', - default: process.env.IS_OSX === 'true', - }) - .option('isRHEL', { - type: 'boolean', - default: process.env.IS_RHEL === 'true', - }) - .option('isUbuntu', { - type: 'boolean', - default: process.env.IS_UBUNTU === 'true', + .option('platform', { + type: 'string', + choices: ['win32', 'darwin', 'linux'], + demandOption: true, + default: process.env.PLATFORM ?? process.platform, }) .option('arch', { type: 'string', @@ -54,15 +53,26 @@ const argv = yargs(hideBin(process.argv)) demandOption: true, default: process.env.ARCH ?? process.arch, }) + .option('package', { + type: 'string', + choices: [ + 'windows_setup', + 'windows_msi', + 'windows_zip', + 'osx_dmg', + 'osx_zip', + 'linux_deb', + 'linux_tar', + 'linux_rpm', + 'rhel_tar', + ], + demandOption: true, + description: 'Which package to test', + }) .option('skipDownload', { type: 'boolean', description: "Don't download all assets before starting", }) - .option('extension', { - type: 'string', - description: - 'If specified it will only run the smoke tests for the specified installer/package', - }) .check((argv) => { if (!argv.skipDownload) { if (!(argv.bucketName && argv.bucketKeyPrefix)) { @@ -72,23 +82,27 @@ const argv = yargs(hideBin(process.argv)) } } - // hadron-build info can only do one platform & arch at a time - const platformsCount = [ - argv.isWindows, - argv.isOSX, - argv.isUbuntu, - argv.isRHEL, - ].filter((x) => x).length; - if (platformsCount !== 1) { - throw new Error( - 'Set exactly one of IS_WINDOWS, IS_OSX, IS_UBUNTU, IS_RHEL to true' - ); - } - return true; }); -type SmokeTestsContext = ReturnType; +type SmokeTestsContext = { + bucketName?: string; + bucketKeyPrefix?: string; + version?: string; + platform: 'win32' | 'darwin' | 'linux'; + arch: 'x64' | 'arm64'; + package: + | 'windows_setup' + | 'windows_msi' + | 'windows_zip' + | 'osx_dmg' + | 'osx_zip' + | 'linux_deb' + | 'linux_tar' + | 'linux_rpm' + | 'rhel_tar'; + skipDownload?: boolean; +}; async function readJson(...segments: string[]): Promise { const result = JSON.parse( @@ -118,20 +132,16 @@ async function run() { 'skipDownload', 'bucketName', 'bucketKeyPrefix', - 'devVersion', - 'isWindows', - 'isOSX', - 'isRHEL', - 'isUbuntu', + 'version', + 'platform', 'arch', - 'extension', + 'package', ]) ); const compassDir = path.resolve(__dirname, '..', '..', 'packages', 'compass'); // use the specified DEV_VERSION_IDENTIFIER if set or load version from packages/compass/package.json - const version = context.devVersion ?? (await readPackageVersion(compassDir)); - const platform = platformFromContext(context); + const version = context.version ?? (await readPackageVersion(compassDir)); const outPath = path.resolve(__dirname, 'hadron-build-info.json'); // build-info @@ -139,7 +149,7 @@ async function run() { format: 'json', dir: compassDir, version, - platform, + platform: context.platform, arch: context.arch, out: outPath, }; @@ -149,186 +159,91 @@ async function run() { assertCommonBuildInfo(buildInfo); - // filter the extensions given the platform (isWindows, isOSX, isUbuntu, isRHEL) and extension - const { isWindows, isOSX, isRHEL, isUbuntu, extension } = context; - - const packages = getFilteredPackages(compassDir, buildInfo, { - isWindows, - isOSX, - isRHEL, - isUbuntu, - extension, - }); - - if (!context.skipDownload) { - await Promise.all( - packages.map(async ({ filename, filepath }) => { - await fs.mkdir(path.dirname(filepath), { recursive: true }); - const url = `https://${context.bucketName}.s3.amazonaws.com/${context.bucketKeyPrefix}/${filename}`; - console.log(url); - return downloadFile(url, filepath); - }) - ); - } - - 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); - await testInstalledApp(appInfo); - } else { - console.log(`no app got installed for ${pkg.filename}`); - } - } -} - -function platformFromContext( - context: SmokeTestsContext -): typeof process.platform { - if (context.isWindows) { - return 'win32'; - } - - if (context.isOSX) { - return 'darwin'; - } - - if (context.isRHEL || context.isUbuntu) { - return 'linux'; - } - - return process.platform; -} - -type PackageFilterConfig = Pick< - SmokeTestsContext, - 'isWindows' | 'isOSX' | 'isRHEL' | 'isUbuntu' | 'extension' ->; - -// subsets of the hadron-build info result - -const commonKeys = ['productName']; -type CommonBuildInfo = Record; - -function assertCommonBuildInfo( - buildInfo: unknown -): asserts buildInfo is CommonBuildInfo { - assert( - typeof buildInfo === 'object' && buildInfo !== null, - 'Expected buildInfo to be an object' - ); - for (const key of commonKeys) { - assert(key in buildInfo, `Expected buildInfo to have '${key}'`); + let match: + | { filename: string; installer: Installer; updatable: boolean } + | undefined = undefined; + + if (context.package === 'windows_setup') { + assertBuildInfoIsWindows(buildInfo); + // TODO + } else if (context.package === 'windows_msi') { + assertBuildInfoIsWindows(buildInfo); + // TODO + } else if (context.package === 'windows_zip') { + assertBuildInfoIsWindows(buildInfo); + // TODO + } else if (context.package === 'osx_dmg') { + assertBuildInfoIsOSX(buildInfo); + + const filename = buildInfo.osx_dmg_filename; + match = { + filename, + installer: installMacDMG, + // The tests need to know whether to expect the path where auto-update + // works automatically or if Compass will only notify the user of an + // update. + updatable: true, + }; + } else if (context.package === 'osx_zip') { + assertBuildInfoIsOSX(buildInfo); + // TODO + } else if (context.package === 'linux_deb') { + assertBuildInfoIsUbuntu(buildInfo); + // TODO + } else if (context.package === 'linux_tar') { + assertBuildInfoIsUbuntu(buildInfo); + // TODO + } else if (context.package === 'linux_rpm') { + assertBuildInfoIsRHEL(buildInfo); + // TODO + } else if (context.package === 'rhel_tar') { + assertBuildInfoIsRHEL(buildInfo); + // TODO } -} - -const windowsFilenameKeys = [ - 'windows_setup_filename', - 'windows_msi_filename', - 'windows_zip_filename', - 'windows_nupkg_full_filename', -] as const; -type WindowsBuildInfo = Record; - -const osxFilenameKeys = ['osx_dmg_filename', 'osx_zip_filename'] as const; -type OSXBuildInfo = Record; - -const ubuntuFilenameKeys = [ - 'linux_deb_filename', - 'linux_tar_filename', -] as const; -type UbuntuBuildInfo = Record; - -const rhelFilenameKeys = ['linux_rpm_filename', 'rhel_tar_filename'] as const; -type RHELBuildInfo = Record; - -function buildInfoIsWindows(buildInfo: any): buildInfo is WindowsBuildInfo { - for (const key of windowsFilenameKeys) { - if (!buildInfo[key]) { - return false; - } - } - return true; -} - -function buildInfoIsOSX(buildInfo: any): buildInfo is OSXBuildInfo { - for (const key of osxFilenameKeys) { - if (!buildInfo[key]) { - return false; - } - } - return true; -} -function buildInfoIsUbuntu(buildInfo: any): buildInfo is UbuntuBuildInfo { - for (const key of ubuntuFilenameKeys) { - if (!buildInfo[key]) { - return false; - } - } - return true; -} + if (match) { + const pkg = { + // we need appName because it is the name of the executable inside the + // package, regardless of what the package filename is named or where it + // gets installed + appName: buildInfo.productName, + packageFilepath: path.join(compassDir, 'dist', match.filename), + // TODO: releaseFilepath once we download the most recent released version too + installer: match.installer, + }; + + if (!context.skipDownload) { + assert( + context.bucketName !== undefined && + context.bucketKeyPrefix !== undefined + ); + await fs.mkdir(path.dirname(pkg.packageFilepath), { recursive: true }); + const url = `https://${context.bucketName}.s3.amazonaws.com/${context.bucketKeyPrefix}/${match.filename}`; + console.log(url); + await downloadFile(url, pkg.packageFilepath); -function buildInfoIsRHEL(buildInfo: any): buildInfo is RHELBuildInfo { - for (const key of rhelFilenameKeys) { - if (!buildInfo[key]) { - return false; + // TODO: we need to also download releaseFilepath once we have that } - } - return true; -} -function getFilteredPackages( - compassDir: string, - buildInfo: any, - config: PackageFilterConfig -): Package[] { - let names: string[] = []; - - if (config.isWindows) { - if (!buildInfoIsWindows(buildInfo)) { - throw new Error('missing windows package keys'); - } - names = windowsFilenameKeys.map((key) => buildInfo[key]); - } else if (config.isOSX) { - if (!buildInfoIsOSX(buildInfo)) { - throw new Error('missing osx package keys'); - } - names = osxFilenameKeys.map((key) => buildInfo[key]); - } else if (config.isRHEL) { - if (!buildInfoIsRHEL(buildInfo)) { - throw new Error('missing rhel package keys'); - } - names = rhelFilenameKeys.map((key) => buildInfo[key]); - } else if (config.isUbuntu) { - if (!buildInfoIsUbuntu(buildInfo)) { - throw new Error('missing ubuntu package keys'); + if (!existsSync(pkg.packageFilepath)) { + throw new Error( + `${pkg.packageFilepath} does not exist. Did you forget to download or package?` + ); } - names = ubuntuFilenameKeys.map((key) => buildInfo[key]); - } - - const extension = config.extension; - return names - .filter((filename) => !extension || filename.endsWith(extension)) - .map((filename) => { - return { - filename, - filepath: path.join(compassDir, 'dist', filename), - }; + // TODO: installing either the packaged file or the released file is better + // done as part of tests so we can also clean up and install one after the + // other, but that's for a separate PR. + console.log('installing', pkg.packageFilepath); + const installedInfo = await pkg.installer({ + appName: pkg.appName, + filepath: pkg.packageFilepath, }); + console.log('testing', installedInfo.appPath); + await testInstalledApp(pkg, installedInfo); + } else { + throw new Error(`${context.package} not implemented`); + } } async function downloadFile(url: string, targetFile: string): Promise { @@ -363,17 +278,10 @@ async function downloadFile(url: string, targetFile: string): Promise { }); } -function verifyPackagesExist(packages: Package[]): void { - for (const { filepath } of packages) { - if (!existsSync(filepath)) { - throw new Error( - `${filepath} does not exist. Did you forget to download or package?` - ); - } - } -} - -function testInstalledApp(appInfo: InstalledAppInfo): Promise { +function testInstalledApp( + pkg: Package, + appInfo: InstalledAppInfo +): Promise { return execute( 'npm', [ @@ -388,7 +296,7 @@ function testInstalledApp(appInfo: InstalledAppInfo): Promise { { env: { ...process.env, - COMPASS_APP_NAME: appInfo.appName, + COMPASS_APP_NAME: pkg.appName, COMPASS_APP_PATH: appInfo.appPath, }, } From 4c8ac8a5283a9d57e2d0b005f4d22e6b42d5630b Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 10 Jan 2025 14:51:06 +0000 Subject: [PATCH 02/10] might help if I use bash comments in a bash script --- .evergreen/functions.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.evergreen/functions.yml b/.evergreen/functions.yml index c1ba6070806..f2b5ee2ae2d 100644 --- a/.evergreen/functions.yml +++ b/.evergreen/functions.yml @@ -670,26 +670,26 @@ functions: eval $(.evergreen/print-compass-env.sh) if [[ "$IS_WINDOWS" == "true" ]]; then - // TODO: windows_setup - // TODO: windows_msi - // TODO: windows_zip + # TODO: windows_setup + # TODO: windows_msi + # TODO: windows_zip fi if [[ "$IS_OSX" == "true" ]]; then echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)" export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true" npm run --unsafe-perm --workspace compass-e2e-tests smoketest -- --package=osx_dmg - // TODO: osx_zip + # TODO: osx_zip fi if [[ "$IS_UBUNTU" == "true" ]]; then - // TODO: linux_deb - // TODO: linux_tar + # TODO: linux_deb + # TODO: linux_tar fi if [[ "$IS_RHEL" == "true" ]]; then - // TODO: linux_rpm - // TODO: rhel_tar + # TODO: linux_rpm + # TODO: rhel_tar fi From 96f28567f21e2dfe70feee132ae165c26e6978ce Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Fri, 10 Jan 2025 15:50:15 +0000 Subject: [PATCH 03/10] more uncommenting --- .evergreen/functions.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.evergreen/functions.yml b/.evergreen/functions.yml index f2b5ee2ae2d..3c9e71dac24 100644 --- a/.evergreen/functions.yml +++ b/.evergreen/functions.yml @@ -669,11 +669,11 @@ functions: # Load environment variables eval $(.evergreen/print-compass-env.sh) - if [[ "$IS_WINDOWS" == "true" ]]; then + #if [[ "$IS_WINDOWS" == "true" ]]; then # TODO: windows_setup # TODO: windows_msi # TODO: windows_zip - fi + #fi if [[ "$IS_OSX" == "true" ]]; then echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)" @@ -682,15 +682,15 @@ functions: # TODO: osx_zip fi - if [[ "$IS_UBUNTU" == "true" ]]; then + #if [[ "$IS_UBUNTU" == "true" ]]; then # TODO: linux_deb # TODO: linux_tar - fi + #fi - if [[ "$IS_RHEL" == "true" ]]; then + #if [[ "$IS_RHEL" == "true" ]]; then # TODO: linux_rpm # TODO: rhel_tar - fi + #fi test-web-sandbox: From 4a6e2d3d45abe412e5b2b417977d3a1598d818d3 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 10:35:06 +0000 Subject: [PATCH 04/10] Update packages/compass-e2e-tests/installers/mac-dmg.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- 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 961ab2598ae..1f4cc0a7a3c 100644 --- a/packages/compass-e2e-tests/installers/mac-dmg.ts +++ b/packages/compass-e2e-tests/installers/mac-dmg.ts @@ -48,7 +48,7 @@ export async function installMacDMG({ } return Promise.resolve({ - appPath: `/Applications/${appName}.app`, + appPath: fullDestinationPath, uninstall: async function () { /* TODO */ }, From 92630b4c19f7a370128ce901022232ebe6c742a1 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 12:30:44 +0000 Subject: [PATCH 05/10] Update packages/compass-e2e-tests/helpers/buildinfo.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- packages/compass-e2e-tests/helpers/buildinfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 7fbd8ae9891..41da5377f03 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -47,7 +47,7 @@ type RHELBuildInfo = CommonBuildInfo & Record; export function assertBuildInfoIsWindows( - buildInfo: any + buildInfo: unknown ): asserts buildInfo is WindowsBuildInfo { assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); assertObjectHasKeys(buildInfo, 'buildInfo', windowsFilenameKeys); From 56c115333a84a064e13568af96fb993cdddb1f09 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 12:30:52 +0000 Subject: [PATCH 06/10] Update packages/compass-e2e-tests/helpers/buildinfo.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- packages/compass-e2e-tests/helpers/buildinfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 41da5377f03..9a0382bce9e 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -54,7 +54,7 @@ export function assertBuildInfoIsWindows( } export function assertBuildInfoIsOSX( - buildInfo: any + buildInfo: unknown ): asserts buildInfo is OSXBuildInfo { assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); assertObjectHasKeys(buildInfo, 'buildInfo', osxFilenameKeys); From 0888f6c9ad666d53a86b84063dcd08e7f1821ca2 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 12:30:58 +0000 Subject: [PATCH 07/10] Update packages/compass-e2e-tests/helpers/buildinfo.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- packages/compass-e2e-tests/helpers/buildinfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 9a0382bce9e..32c9e7405f2 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -61,7 +61,7 @@ export function assertBuildInfoIsOSX( } export function assertBuildInfoIsUbuntu( - buildInfo: any + buildInfo: unknown ): buildInfo is UbuntuBuildInfo { assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); assertObjectHasKeys(buildInfo, 'buildInfo', ubuntuFilenameKeys); From 4b928e08b6d64f0179cea31c2b5754c8387ebb7e Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 12:31:06 +0000 Subject: [PATCH 08/10] Update packages/compass-e2e-tests/helpers/buildinfo.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- packages/compass-e2e-tests/helpers/buildinfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 32c9e7405f2..2acc367fd23 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict'; const commonKeys = ['productName']; type CommonBuildInfo = Record; -function assertObjectHasKeys(obj: any, name: string, keys: readonly string[]) { +function assertObjectHasKeys(obj: unknown, name: string, keys: readonly string[]) { assert( typeof obj === 'object' && obj !== null, 'Expected buildInfo to be an object' From 50e565bb16cc0d833dd15569bb7095e720672d02 Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 12:31:13 +0000 Subject: [PATCH 09/10] Update packages/compass-e2e-tests/helpers/buildinfo.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kræn Hansen --- packages/compass-e2e-tests/helpers/buildinfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 2acc367fd23..1c23845f5ee 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -69,7 +69,7 @@ export function assertBuildInfoIsUbuntu( } export function assertBuildInfoIsRHEL( - buildInfo: any + buildInfo: unknown ): asserts buildInfo is RHELBuildInfo { assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); assertObjectHasKeys(buildInfo, 'buildInfo', rhelFilenameKeys); From 4b7fb81e9030c767e7a479df8153f5fcf5ad5ddf Mon Sep 17 00:00:00 2001 From: Le Roux Bodenstein Date: Mon, 13 Jan 2025 13:06:49 +0000 Subject: [PATCH 10/10] prettier --- packages/compass-e2e-tests/helpers/buildinfo.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/helpers/buildinfo.ts b/packages/compass-e2e-tests/helpers/buildinfo.ts index 1c23845f5ee..37d1d37c8ee 100644 --- a/packages/compass-e2e-tests/helpers/buildinfo.ts +++ b/packages/compass-e2e-tests/helpers/buildinfo.ts @@ -5,7 +5,11 @@ import assert from 'node:assert/strict'; const commonKeys = ['productName']; type CommonBuildInfo = Record; -function assertObjectHasKeys(obj: unknown, name: string, keys: readonly string[]) { +function assertObjectHasKeys( + obj: unknown, + name: string, + keys: readonly string[] +) { assert( typeof obj === 'object' && obj !== null, 'Expected buildInfo to be an object'