From fe57cb1094440dc79c7f2b5b3a98144cd50393c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Fri, 7 Feb 2025 11:49:46 +0100 Subject: [PATCH 1/3] Implement Linux tar installer --- .../src/installers/index.ts | 3 +++ .../src/installers/linux-tar.ts | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 packages/compass-smoke-tests/src/installers/linux-tar.ts diff --git a/packages/compass-smoke-tests/src/installers/index.ts b/packages/compass-smoke-tests/src/installers/index.ts index 31fc022b0c0..4a37c38b991 100644 --- a/packages/compass-smoke-tests/src/installers/index.ts +++ b/packages/compass-smoke-tests/src/installers/index.ts @@ -4,6 +4,7 @@ import { installMacZIP } from './mac-zip'; import { installWindowsZIP } from './windows-zip'; import { installWindowsMSI } from './windows-msi'; import { installWindowsSetup } from './windows-setup'; +import { installLinuxTar } from './linux-tar'; export function getInstaller(kind: PackageKind) { if (kind === 'osx_dmg') { @@ -16,6 +17,8 @@ export function getInstaller(kind: PackageKind) { return installWindowsMSI; } else if (kind === 'windows_setup') { return installWindowsSetup; + } else if (kind === 'linux_tar') { + return installLinuxTar; } else { throw new Error(`Installer for '${kind}' is not yet implemented`); } diff --git a/packages/compass-smoke-tests/src/installers/linux-tar.ts b/packages/compass-smoke-tests/src/installers/linux-tar.ts new file mode 100644 index 00000000000..98e17f29974 --- /dev/null +++ b/packages/compass-smoke-tests/src/installers/linux-tar.ts @@ -0,0 +1,25 @@ +import path from 'node:path'; + +import type { InstalledAppInfo, InstallablePackage } from './types'; +import { execute } from '../execute'; + +export function installLinuxTar({ + appName, + filepath, + destinationPath, +}: InstallablePackage): InstalledAppInfo { + const appFilename = `${appName}-linux-x64`; + const appPath = path.resolve(destinationPath, appFilename); + + execute('tar', ['-xzf', filepath, '-C', destinationPath]); + + // Check that the executable will run without being quarantined or similar + execute(path.resolve(appPath, appName), ['--version']); + + return { + appPath, + uninstall: async function () { + /* TODO */ + }, + }; +} From 5a756d5c85b9efe4a9ebe7c926f5234354dfaa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Fri, 7 Feb 2025 12:22:55 +0100 Subject: [PATCH 2/3] Extract verbose and use xvfb-run --- packages/compass-smoke-tests/src/installers/linux-tar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compass-smoke-tests/src/installers/linux-tar.ts b/packages/compass-smoke-tests/src/installers/linux-tar.ts index 98e17f29974..5c999a99520 100644 --- a/packages/compass-smoke-tests/src/installers/linux-tar.ts +++ b/packages/compass-smoke-tests/src/installers/linux-tar.ts @@ -11,10 +11,10 @@ export function installLinuxTar({ const appFilename = `${appName}-linux-x64`; const appPath = path.resolve(destinationPath, appFilename); - execute('tar', ['-xzf', filepath, '-C', destinationPath]); + execute('tar', ['-xzvf', filepath, '-C', destinationPath]); // Check that the executable will run without being quarantined or similar - execute(path.resolve(appPath, appName), ['--version']); + execute('xvfb-run', [path.resolve(appPath, appName), '--version']); return { appPath, From 026ae509f18571b2109fe0dcced4cd3171bd2557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 10 Feb 2025 09:44:06 +0100 Subject: [PATCH 3/3] Arm CI to run time-to-first-query for linux_tar --- .evergreen/buildvariants-and-tasks.in.yml | 12 ++++++------ .evergreen/buildvariants-and-tasks.yml | 8 ++++++++ .evergreen/functions.yml | 12 ++++++------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.evergreen/buildvariants-and-tasks.in.yml b/.evergreen/buildvariants-and-tasks.in.yml index b77e22cc5b3..f71430e47b3 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', display_name: 'Smoketest Windows', diff --git a/.evergreen/buildvariants-and-tasks.yml b/.evergreen/buildvariants-and-tasks.yml index d17f929c9b8..1404072ff04 100644 --- a/.evergreen/buildvariants-and-tasks.yml +++ b/.evergreen/buildvariants-and-tasks.yml @@ -76,6 +76,14 @@ 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-windows-compass display_name: Smoketest Windows (compass) run_on: windows-vsCurrent-large diff --git a/.evergreen/functions.yml b/.evergreen/functions.yml index 3a450402af7..6fd181879c1 100644 --- a/.evergreen/functions.yml +++ b/.evergreen/functions.yml @@ -692,15 +692,15 @@ functions: npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=osx_dmg --tests=time-to-first-query fi - #if [[ "$IS_UBUNTU" == "true" ]]; then + if [[ "$IS_UBUNTU" == "true" ]]; then # TODO: linux_deb - # TODO: linux_tar - #fi + npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query + fi - #if [[ "$IS_RHEL" == "true" ]]; then + if [[ "$IS_RHEL" == "true" ]]; then # TODO: linux_rpm - # TODO: rhel_tar - #fi + npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query + fi test-web-sandbox: - command: shell.exec