File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
packages/compass-smoke-tests/src Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import {
1414import { createSandbox } from './directories' ;
1515import { downloadFile } from './downloads' ;
1616import { type PackageKind , SUPPORTED_PACKAGES } from './packages' ;
17- import { getLatestRelease } from './releases' ;
17+ import { getLatestRelease , getLatestReleaseKindByKind } from './releases' ;
1818import { SUPPORTED_TESTS } from './tests/types' ;
1919import { 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 ,
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments