Skip to content

Commit a066fa8

Browse files
authored
chore(e2e): throw if we're unexpectedly building Compass COMPASS-8615 (#6618)
throw if we're unexpectedly building Compass
1 parent 7543fc5 commit a066fa8

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/compass-e2e-tests/helpers/compass.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,18 +949,20 @@ async function getCompassBuildMetadata(): Promise<BinPathOptions> {
949949
}
950950

951951
export async function buildCompass(
952-
force = false,
953952
compassPath = COMPASS_DESKTOP_PATH
954953
): Promise<void> {
955-
if (!force) {
956-
try {
957-
await getCompassBuildMetadata();
958-
return;
959-
} catch (e) {
960-
// No compass build found, let's build it
961-
}
954+
try {
955+
await getCompassBuildMetadata();
956+
return;
957+
} catch (e) {
958+
/* ignore */
959+
}
960+
961+
if (process.env.COMPASS_APP_PATH && process.env.COMPASS_APP_NAME) {
962+
throw new Error('We did not expect to have to build Compass');
962963
}
963964

965+
debug("No Compass build found, let's build it");
964966
await packageCompassAsync({
965967
dir: compassPath,
966968
skip_installer: true,

packages/compass-e2e-tests/helpers/test-runner-global-fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export async function mochaGlobalSetup(this: Mocha.Runner) {
139139

140140
if (isTestingDesktop(context)) {
141141
if (context.testPackagedApp) {
142-
debug('Building Compass before running the tests ...');
142+
debug('Maybe building Compass before running the tests ...');
143143
await buildCompass();
144144
} else {
145145
debug('Preparing Compass before running the tests');

0 commit comments

Comments
 (0)