Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(smoke-tests): test updating from the latest release to the newly packaged app COMPASS-8532 COMPASS-8535 #6669

Merged
merged 11 commits into from
Feb 7, 2025
Prev Previous commit
Next Next commit
the installer to use for the latest release is not necessarily the sa…
…me as the package
  • Loading branch information
lerouxb committed Jan 31, 2025
commit a897d930da90266ff9b2e5ca3b55d0cf4663af89
7 changes: 5 additions & 2 deletions packages/compass-smoke-tests/src/cli.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import {
import { createSandbox } from './directories';
import { downloadFile } from './downloads';
import { type PackageKind, SUPPORTED_PACKAGES } from './packages';
import { getLatestRelease } from './releases';
import { getLatestRelease, getLatestReleaseKindByKind } from './releases';
import { SUPPORTED_TESTS } from './tests/types';
import { type SmokeTestsContext } from './context';

@@ -207,7 +207,6 @@ async function run() {
buildInfo: { channel, version },
autoUpdatable,
} = await getTestSubject(context);
const install = getInstaller(kind);

try {
if (context.tests.length === 0) {
@@ -225,6 +224,10 @@ async function run() {
)
: filepath;

const install = getInstaller(
testName === 'auto-update-to' ? getLatestReleaseKindByKind(kind) : kind
);

const { appPath, uninstall } = install({
appName,
filepath: installerPath,
24 changes: 24 additions & 0 deletions packages/compass-smoke-tests/src/releases.ts
Original file line number Diff line number Diff line change
@@ -89,3 +89,27 @@ export async function getLatestRelease(
clearCache: forceDownload,
});
}

export function getLatestReleaseKindByKind(kind: PackageKind): PackageKind {
if (kind === 'osx_dmg' || kind === 'osx_zip') {
return 'osx_dmg';
}

if (
kind === 'windows_setup' ||
kind === 'windows_msi' ||
kind === 'windows_zip'
) {
return 'windows_setup';
}

if (kind === 'linux_deb' || kind === 'linux_tar') {
return 'linux_deb';
}

if (kind === 'linux_rpm' || kind === 'rhel_tar') {
return 'linux_rpm';
}

throw new Error(`Unsupported kind: ${kind as string}`);
}