Skip to content

Commit b940193

Browse files
authored
chore(smoke-tests): skip uninstalling when running on GHA (#6724)
Skip uninstalling
1 parent 7cf5cfb commit b940193

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

.github/workflows/test-installers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,5 @@ jobs:
177177
# Exposing token to prevent update server from being rate limited
178178
GITHUB_TOKEN: ${{ github.token }}
179179
working-directory: packages/compass-smoke-tests
180-
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}
180+
# Using --skipUninstalling --skipCleanup because the runners are ephemeral
181+
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }} --skipUninstall --skipCleanup

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ const argv = yargs(hideBin(process.argv))
9696
description: 'Do not delete the sandboxes after a run',
9797
default: false,
9898
})
99+
.option('skipUninstall', {
100+
type: 'boolean',
101+
description: 'Do not uninstall after a run',
102+
default: false,
103+
})
99104
.option('tests', {
100105
type: 'array',
101106
string: true,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type SmokeTestsContext = {
1111
localPackage?: boolean;
1212
tests: TestName[];
1313
skipCleanup: boolean;
14+
skipUninstall: boolean;
1415
};
1516

1617
export type SmokeTestsContextWithSandbox = SmokeTestsContext & {

packages/compass-smoke-tests/src/tests/auto-update-from.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export async function testAutoUpdateFrom(context: SmokeTestsContext) {
7373
delete process.env.UPDATE_CHECKER_ALLOW_DOWNGRADES;
7474
}
7575
} finally {
76-
debug('Uninstalling');
77-
await uninstall();
76+
if (context.skipUninstall) {
77+
debug('Skipped uninstalling');
78+
} else {
79+
debug('Uninstalling');
80+
await uninstall();
81+
}
7882
}
7983
}

packages/compass-smoke-tests/src/tests/auto-update-to.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ export async function testAutoUpdateTo(context: SmokeTestsContext) {
107107
delete process.env.UPDATE_CHECKER_ALLOW_DOWNGRADES;
108108
}
109109
} finally {
110-
debug('Uninstalling');
111-
await uninstall();
110+
if (context.skipUninstall) {
111+
debug('Skipped uninstalling');
112+
} else {
113+
debug('Uninstalling');
114+
await uninstall();
115+
}
112116
}
113117
}

packages/compass-smoke-tests/src/tests/time-to-first-query.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ export async function testTimeToFirstQuery(context: SmokeTestsContext) {
4747
}
4848
);
4949
} finally {
50-
debug('Uninstalling');
51-
await uninstall();
50+
if (context.skipUninstall) {
51+
debug('Skipped uninstalling');
52+
} else {
53+
debug('Uninstalling');
54+
await uninstall();
55+
}
5256
}
5357
}

0 commit comments

Comments
 (0)