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

chore(e2e): throw if we're unexpectedly building Compass COMPASS-8615 #6618

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/compass-e2e-tests/helpers/compass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,18 +949,20 @@ async function getCompassBuildMetadata(): Promise<BinPathOptions> {
}

export async function buildCompass(
force = false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by, but we never use this

compassPath = COMPASS_DESKTOP_PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the second parameter became the first, but we never pass either of these parameters, so that didn't require other changes.

): Promise<void> {
if (!force) {
try {
await getCompassBuildMetadata();
return;
} catch (e) {
// No compass build found, let's build it
}
try {
await getCompassBuildMetadata();
return;
} catch (e) {
/* ignore */
}

if (process.env.COMPASS_APP_PATH && process.env.COMPASS_APP_NAME) {
throw new Error('We did not expect to have to build Compass');
}

debug("No Compass build found, let's build it");
await packageCompassAsync({
dir: compassPath,
skip_installer: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export async function mochaGlobalSetup(this: Mocha.Runner) {

if (isTestingDesktop(context)) {
if (context.testPackagedApp) {
debug('Building Compass before running the tests ...');
debug('Maybe building Compass before running the tests ...');
await buildCompass();
} else {
debug('Preparing Compass before running the tests');
Expand Down
Loading