Skip to content

Commit 5e68065

Browse files
authored
feat(smoke-tests): test tar installer for on Ubuntu COMPASS-8711 (#6684)
* Implement Linux tar installer * Extract verbose and use xvfb-run * Arm CI to run time-to-first-query for linux_tar
1 parent dce4a17 commit 5e68065

File tree

5 files changed

+48
-12
lines changed

5 files changed

+48
-12
lines changed

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ const PACKAGE_BUILD_VARIANTS = [
6161
];
6262
6363
const SMOKETEST_BUILD_VARIANTS = [
64-
// {
65-
// name: 'smoketest-ubuntu',
66-
// display_name: 'Smoketest Ubuntu',
67-
// run_on: 'ubuntu2004-large',
68-
// depends_on: 'package-ubuntu',
69-
// },
64+
{
65+
name: 'smoketest-ubuntu',
66+
display_name: 'Smoketest Ubuntu',
67+
run_on: 'ubuntu2004-large',
68+
depends_on: 'package-ubuntu',
69+
},
7070
{
7171
name: 'smoketest-windows',
7272
display_name: 'Smoketest Windows',

.evergreen/buildvariants-and-tasks.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ buildvariants:
7676
- name: package-compass
7777
- name: package-compass-isolated
7878
- name: package-compass-readonly
79+
- name: smoketest-ubuntu-compass
80+
display_name: Smoketest Ubuntu (compass)
81+
run_on: ubuntu2004-large
82+
depends_on:
83+
- name: package-compass
84+
variant: package-ubuntu
85+
tasks:
86+
- name: smoketest-compass
7987
- name: smoketest-windows-compass
8088
display_name: Smoketest Windows (compass)
8189
run_on: windows-vsCurrent-large

.evergreen/functions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,15 +692,15 @@ functions:
692692
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=osx_dmg --tests=time-to-first-query
693693
fi
694694
695-
#if [[ "$IS_UBUNTU" == "true" ]]; then
695+
if [[ "$IS_UBUNTU" == "true" ]]; then
696696
# TODO: linux_deb
697-
# TODO: linux_tar
698-
#fi
697+
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query
698+
fi
699699
700-
#if [[ "$IS_RHEL" == "true" ]]; then
700+
if [[ "$IS_RHEL" == "true" ]]; then
701701
# TODO: linux_rpm
702-
# TODO: rhel_tar
703-
#fi
702+
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=linux_tar --tests=time-to-first-query
703+
fi
704704
705705
test-web-sandbox:
706706
- command: shell.exec

packages/compass-smoke-tests/src/installers/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { installMacZIP } from './mac-zip';
44
import { installWindowsZIP } from './windows-zip';
55
import { installWindowsMSI } from './windows-msi';
66
import { installWindowsSetup } from './windows-setup';
7+
import { installLinuxTar } from './linux-tar';
78

89
export function getInstaller(kind: PackageKind) {
910
if (kind === 'osx_dmg') {
@@ -16,6 +17,8 @@ export function getInstaller(kind: PackageKind) {
1617
return installWindowsMSI;
1718
} else if (kind === 'windows_setup') {
1819
return installWindowsSetup;
20+
} else if (kind === 'linux_tar') {
21+
return installLinuxTar;
1922
} else {
2023
throw new Error(`Installer for '${kind}' is not yet implemented`);
2124
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import path from 'node:path';
2+
3+
import type { InstalledAppInfo, InstallablePackage } from './types';
4+
import { execute } from '../execute';
5+
6+
export function installLinuxTar({
7+
appName,
8+
filepath,
9+
destinationPath,
10+
}: InstallablePackage): InstalledAppInfo {
11+
const appFilename = `${appName}-linux-x64`;
12+
const appPath = path.resolve(destinationPath, appFilename);
13+
14+
execute('tar', ['-xzvf', filepath, '-C', destinationPath]);
15+
16+
// Check that the executable will run without being quarantined or similar
17+
execute('xvfb-run', [path.resolve(appPath, appName), '--version']);
18+
19+
return {
20+
appPath,
21+
uninstall: async function () {
22+
/* TODO */
23+
},
24+
};
25+
}

0 commit comments

Comments
 (0)