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 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..5c999a99520 --- /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', ['-xzvf', filepath, '-C', destinationPath]); + + // Check that the executable will run without being quarantined or similar + execute('xvfb-run', [path.resolve(appPath, appName), '--version']); + + return { + appPath, + uninstall: async function () { + /* TODO */ + }, + }; +}