Skip to content

Commit

Permalink
chore(smoke-tests): skip uninstalling when running on GHA (#6724)
Browse files Browse the repository at this point in the history
Skip uninstalling
  • Loading branch information
kraenhansen authored Feb 17, 2025
1 parent 7cf5cfb commit b940193
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,5 @@ jobs:
# Exposing token to prevent update server from being rate limited
GITHUB_TOKEN: ${{ github.token }}
working-directory: packages/compass-smoke-tests
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}
# Using --skipUninstalling --skipCleanup because the runners are ephemeral
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }} --skipUninstall --skipCleanup
5 changes: 5 additions & 0 deletions packages/compass-smoke-tests/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ const argv = yargs(hideBin(process.argv))
description: 'Do not delete the sandboxes after a run',
default: false,
})
.option('skipUninstall', {
type: 'boolean',
description: 'Do not uninstall after a run',
default: false,
})
.option('tests', {
type: 'array',
string: true,
Expand Down
1 change: 1 addition & 0 deletions packages/compass-smoke-tests/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type SmokeTestsContext = {
localPackage?: boolean;
tests: TestName[];
skipCleanup: boolean;
skipUninstall: boolean;
};

export type SmokeTestsContextWithSandbox = SmokeTestsContext & {
Expand Down
8 changes: 6 additions & 2 deletions packages/compass-smoke-tests/src/tests/auto-update-from.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ export async function testAutoUpdateFrom(context: SmokeTestsContext) {
delete process.env.UPDATE_CHECKER_ALLOW_DOWNGRADES;
}
} finally {
debug('Uninstalling');
await uninstall();
if (context.skipUninstall) {
debug('Skipped uninstalling');
} else {
debug('Uninstalling');
await uninstall();
}
}
}
8 changes: 6 additions & 2 deletions packages/compass-smoke-tests/src/tests/auto-update-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ export async function testAutoUpdateTo(context: SmokeTestsContext) {
delete process.env.UPDATE_CHECKER_ALLOW_DOWNGRADES;
}
} finally {
debug('Uninstalling');
await uninstall();
if (context.skipUninstall) {
debug('Skipped uninstalling');
} else {
debug('Uninstalling');
await uninstall();
}
}
}
8 changes: 6 additions & 2 deletions packages/compass-smoke-tests/src/tests/time-to-first-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export async function testTimeToFirstQuery(context: SmokeTestsContext) {
}
);
} finally {
debug('Uninstalling');
await uninstall();
if (context.skipUninstall) {
debug('Skipped uninstalling');
} else {
debug('Uninstalling');
await uninstall();
}
}
}

0 comments on commit b940193

Please sign in to comment.