Skip to content

Commit 6eaf996

Browse files
committed
cleanup
1 parent 3dc10f5 commit 6eaf996

File tree

4 files changed

+9
-49
lines changed

4 files changed

+9
-49
lines changed

packages/compass-e2e-tests/tests/auto-update.test.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import fs from 'fs';
2-
import path from 'path';
31
import { expect } from 'chai';
42
import {
53
init,
64
cleanup,
75
Selectors,
86
screenshotPathName,
97
} from '../helpers/compass';
10-
import { LOG_PATH } from '../helpers/test-runner-paths';
118

129
function wait(ms: number) {
1310
return new Promise((resolve) => {
@@ -51,30 +48,13 @@ describe('Auto-update', function () {
5148
} finally {
5249
await browser.screenshot(screenshotPathName('auto-update-from'));
5350
await cleanup(compass);
54-
55-
if (process.platform === 'darwin' && process.env.HOME) {
56-
console.log('copying ShipIt dir if it exits');
57-
const shipitDir = path.resolve(
58-
process.env.HOME,
59-
'Library',
60-
'Caches',
61-
'com.mongodb.compass.dev.ShipIt'
62-
);
63-
64-
if (fs.existsSync(shipitDir)) {
65-
console.log(`copying ${shipitDir}`);
66-
fs.cpSync(shipitDir, `${LOG_PATH}/ShipIt`, { recursive: true });
67-
} else {
68-
console.log(`${shipitDir} does not exist`);
69-
}
70-
}
7151
}
7252

7353
if (process.env.AUTO_UPDATE_UPDATABLE === 'true') {
7454
console.log(
7555
'pause to make sure the app properly exited before starting again'
7656
);
77-
await wait(60_000);
57+
await wait(10_000);
7858

7959
console.log('starting compass a second time');
8060
// run the app again and check that the version changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async function run() {
197197
if (context.platform === 'darwin' && process.env.CI) {
198198
// Auto-update does not work on mac in CI at the moment. So in that case
199199
// we just run the E2E tests to make sure the app at least starts up.
200-
runE2ETest({
200+
runTimeToFirstQuery({
201201
appName,
202202
appPath,
203203
});
@@ -264,7 +264,7 @@ type RunE2ETestOptions = {
264264
appPath: string;
265265
};
266266

267-
function runE2ETest({ appName, appPath }: RunE2ETestOptions) {
267+
function runTimeToFirstQuery({ appName, appPath }: RunE2ETestOptions) {
268268
execute(
269269
'npm',
270270
[

packages/compass-smoke-tests/src/installers/mac-dmg.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export function installMacDMG({
1515

1616
execute('hdiutil', ['attach', filepath]);
1717

18-
execute('umask', []);
19-
2018
try {
2119
fs.cpSync(path.resolve(volumePath, appFilename), appPath, {
2220
recursive: true,
@@ -35,18 +33,10 @@ export function installMacDMG({
3533
'Application Support',
3634
appName
3735
);
38-
const shipitDir = path.resolve(
39-
process.env.HOME,
40-
'Library',
41-
'Caches',
42-
'com.mongodb.compass.dev.ShipIt'
43-
);
4436

45-
for (const dir of [settingsDir, shipitDir]) {
46-
if (fs.existsSync(dir)) {
47-
console.log(`${dir} already exists. Removing.`);
48-
fs.rmSync(dir, { recursive: true });
49-
}
37+
if (fs.existsSync(settingsDir)) {
38+
console.log(`${settingsDir} already exists. Removing.`);
39+
fs.rmSync(settingsDir, { recursive: true });
5040
}
5141
}
5242

packages/compass-smoke-tests/src/installers/mac-zip.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export function installMacZIP({
1212
const appFilename = `${appName}.app`;
1313
const appPath = path.resolve(destinationPath, appFilename);
1414

15-
execute('umask', []);
16-
1715
execute('ditto', ['-xk', filepath, destinationPath]);
1816

1917
// TODO: Consider instrumenting the app to use a settings directory in the sandbox
@@ -25,18 +23,10 @@ export function installMacZIP({
2523
'Application Support',
2624
appName
2725
);
28-
const shipitDir = path.resolve(
29-
process.env.HOME,
30-
'Library',
31-
'Caches',
32-
'com.mongodb.compass.dev.ShipIt'
33-
);
3426

35-
for (const dir of [settingsDir, shipitDir]) {
36-
if (fs.existsSync(dir)) {
37-
console.log(`${dir} already exists. Removing.`);
38-
fs.rmSync(dir, { recursive: true });
39-
}
27+
if (fs.existsSync(settingsDir)) {
28+
console.log(`${settingsDir} already exists. Removing.`);
29+
fs.rmSync(settingsDir, { recursive: true });
4030
}
4131
}
4232

0 commit comments

Comments
 (0)