Skip to content

Commit a897d93

Browse files
committed
the installer to use for the latest release is not necessarily the same as the package
1 parent 1ec2465 commit a897d93

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

packages/compass-smoke-tests/src/cli.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { createSandbox } from './directories';
1515
import { downloadFile } from './downloads';
1616
import { type PackageKind, SUPPORTED_PACKAGES } from './packages';
17-
import { getLatestRelease } from './releases';
17+
import { getLatestRelease, getLatestReleaseKindByKind } from './releases';
1818
import { SUPPORTED_TESTS } from './tests/types';
1919
import { type SmokeTestsContext } from './context';
2020

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

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

227+
const install = getInstaller(
228+
testName === 'auto-update-to' ? getLatestReleaseKindByKind(kind) : kind
229+
);
230+
228231
const { appPath, uninstall } = install({
229232
appName,
230233
filepath: installerPath,

packages/compass-smoke-tests/src/releases.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,27 @@ export async function getLatestRelease(
8989
clearCache: forceDownload,
9090
});
9191
}
92+
93+
export function getLatestReleaseKindByKind(kind: PackageKind): PackageKind {
94+
if (kind === 'osx_dmg' || kind === 'osx_zip') {
95+
return 'osx_dmg';
96+
}
97+
98+
if (
99+
kind === 'windows_setup' ||
100+
kind === 'windows_msi' ||
101+
kind === 'windows_zip'
102+
) {
103+
return 'windows_setup';
104+
}
105+
106+
if (kind === 'linux_deb' || kind === 'linux_tar') {
107+
return 'linux_deb';
108+
}
109+
110+
if (kind === 'linux_rpm' || kind === 'rhel_tar') {
111+
return 'linux_rpm';
112+
}
113+
114+
throw new Error(`Unsupported kind: ${kind as string}`);
115+
}

0 commit comments

Comments
 (0)