Skip to content

Commit 13fbe2d

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents b8ee3db + ea8a5b2 commit 13fbe2d

File tree

12 files changed

+220
-32
lines changed

12 files changed

+220
-32
lines changed

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ const SMOKETEST_BUILD_VARIANTS = [
8080
// run_on: 'rhel80-large',
8181
// depends_on: 'package-rhel',
8282
// },
83-
// {
84-
// name: 'smoketest-macos-x64',
85-
// display_name: 'Smoketest MacOS Intel',
86-
// run_on: 'macos-14',
87-
// depends_on: 'package-macos-x64',
88-
// },
89-
// {
90-
// name: 'smoketest-macos-arm',
91-
// display_name: 'Smoketest MacOS Arm64',
92-
// run_on: 'macos-14-arm64',
93-
// depends_on: 'package-macos-arm',
94-
// }
83+
{
84+
name: 'smoketest-macos-x64',
85+
display_name: 'Smoketest MacOS Intel',
86+
run_on: 'macos-14-gui',
87+
depends_on: 'package-macos-x64',
88+
},
89+
{
90+
name: 'smoketest-macos-arm',
91+
display_name: 'Smoketest MacOS Arm64',
92+
run_on: 'macos-14-arm64-gui',
93+
depends_on: 'package-macos-arm',
94+
}
9595
];
9696
9797
const TEST_PACKAGED_APP_BUILD_VARIANTS = [

.evergreen/buildvariants-and-tasks.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ buildvariants:
8484
variant: package-ubuntu
8585
tasks:
8686
- name: smoketest-compass
87+
- name: smoketest-macos-x64-compass
88+
display_name: Smoketest MacOS Intel (compass)
89+
run_on: macos-14-gui
90+
depends_on:
91+
- name: package-compass
92+
variant: package-macos-x64
93+
tasks:
94+
- name: smoketest-compass
95+
- name: smoketest-macos-arm-compass
96+
display_name: Smoketest MacOS Arm64 (compass)
97+
run_on: macos-14-arm64-gui
98+
depends_on:
99+
- name: package-compass
100+
variant: package-macos-arm
101+
tasks:
102+
- name: smoketest-compass
87103
- name: test-eol-servers
88104
display_name: Test EoL Servers
89105
run_on: ubuntu1804-large

.evergreen/functions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ functions:
674674
export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true"
675675
fi
676676
677-
npm run --workspace compass-e2e-tests smoketest
677+
npm run --unsafe-perm --workspace compass-e2e-tests smoketest
678678
679679
test-web-sandbox:
680680
- command: shell.exec

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Sun Dec 22 2024.
2+
This document was automatically generated on Sun Dec 29 2024.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Compass Tracking Plan
33

4-
Generated on Sun, Dec 22, 2024 at 03:15 AM
4+
Generated on Sun, Dec 29, 2024 at 03:16 AM
55

66
## Table of Contents
77

packages/compass-e2e-tests/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
fixtures
44
.nyc_output
55
coverage
6+
hadron-build-info.json

packages/compass-e2e-tests/helpers/chrome-startup-flags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copied from https://github.com/webdriverio/webdriverio/blob/1825c633aead82bc650dff1f403ac30cff7c7cb3/packages/devtools/src/constants.ts
22
// These are the default flags that webdriverio uses to start Chrome driver.
3+
// NOTE: this has since been removed along with the devtools automation protocol https://github.com/webdriverio/webdriverio/commit/28e64e439ffc36a95f24aeda9f1d21111429dfa3#diff-6ea151d6c0687197931735239f397b7f5f0140a588c5b2b82ff584bbe73be069
34
const DEFAULT_WEBDRIVER_FLAGS = [
45
// suppresses Save Password prompt window
56
'--enable-automation',

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ async function processCommonOpts({
547547

548548
// https://webdriver.io/docs/options/#webdriver-options
549549
const webdriverOptions = {
550-
logLevel: 'warn' as const, // info is super verbose right now
550+
logLevel: 'trace' as const,
551551
outputDir: webdriverLogPath,
552552
};
553553

@@ -601,7 +601,9 @@ async function startCompassElectron(
601601
// See https://www.electronjs.org/docs/latest/api/command-line-switches#--enable-loggingfile
602602
'--enable-logging=file',
603603
// See https://www.electronjs.org/docs/latest/api/command-line-switches#--log-filepath
604-
`--log-file=${electronLogFile}`
604+
`--log-file=${electronLogFile}`,
605+
// See https://chromium.googlesource.com/chromium/src/+/master/docs/chrome_os_logging.md
606+
'--log-level=0'
605607
);
606608

607609
if (opts.extraSpawnArgs) {
@@ -643,9 +645,13 @@ async function startCompassElectron(
643645
},
644646
// from https://github.com/webdriverio-community/wdio-electron-service/blob/32457f60382cb4970c37c7f0a19f2907aaa32443/packages/wdio-electron-service/src/launcher.ts#L102
645647
'wdio:enforceWebDriverClassic': true,
646-
},
647-
'wdio:chromedriverOptions': {
648-
// TODO: enable logging so we don't have to debug things blindly
648+
'wdio:chromedriverOptions': {
649+
// enable logging so we don't have to debug things blindly
650+
// This goes in .log/webdriver/wdio-chromedriver-*.log. It is the
651+
// chromedriver log and since this is verbose it also contains the
652+
// stdout of the electron main process.
653+
verbose: true,
654+
},
649655
},
650656
...webdriverOptions,
651657
...wdioOptions,
@@ -657,7 +663,10 @@ async function startCompassElectron(
657663
let browser: CompassBrowser;
658664

659665
try {
660-
browser = (await remote(options)) as CompassBrowser;
666+
// webdriverio's type is wrong for
667+
// options.capabilities['wdio:chromedriverOptions'] and it doesn't allow
668+
// verbose even though it does work
669+
browser = (await remote(options as any)) as CompassBrowser;
661670
} catch (err) {
662671
debug('Failed to start remote webdriver session', {
663672
error: (err as Error).stack,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { spawn } from 'child_process';
2+
import type { SpawnOptions } from 'child_process';
3+
4+
export function execute(
5+
command: string,
6+
args: string[],
7+
options?: SpawnOptions
8+
): Promise<void> {
9+
return new Promise((resolve, reject) => {
10+
console.log(command, ...args);
11+
const p = spawn(command, args, {
12+
stdio: 'inherit',
13+
...options,
14+
});
15+
p.on('error', (err: any) => {
16+
reject(err);
17+
});
18+
p.on('close', (code: number | null, signal: NodeJS.Signals | null) => {
19+
if (code !== null) {
20+
if (code === 0) {
21+
resolve();
22+
} else {
23+
reject(
24+
new Error(`${command} ${args.join(' ')} exited with code ${code}`)
25+
);
26+
}
27+
} else {
28+
if (signal !== null) {
29+
reject(
30+
new Error(
31+
`${command} ${args.join(' ')} exited with signal ${signal}`
32+
)
33+
);
34+
} else {
35+
// shouldn't happen
36+
reject(
37+
new Error(
38+
`${command} ${args.join(' ')} exited with no code or signal`
39+
)
40+
);
41+
}
42+
}
43+
});
44+
});
45+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import path from 'path';
2+
import { existsSync } from 'fs';
3+
import type { InstalledAppInfo, Package } from './types';
4+
import { execute } from './helpers';
5+
6+
export async function installMacDMG(
7+
appName: string,
8+
{ filepath }: Package
9+
): Promise<InstalledAppInfo> {
10+
const fullDestinationPath = `/Applications/${appName}.app`;
11+
12+
if (existsSync(fullDestinationPath)) {
13+
// Would ideally just throw here, but unfortunately in CI the mac
14+
// environments aren't all clean so somewhere we have to remove it anyway.
15+
console.log(`${fullDestinationPath} already exists. Removing.`);
16+
await execute('rm', ['-rf', fullDestinationPath]);
17+
}
18+
19+
await execute('hdiutil', ['attach', filepath]);
20+
try {
21+
await execute('cp', [
22+
'-Rp',
23+
`/Volumes/${appName}/${appName}.app`,
24+
'/Applications',
25+
]);
26+
} finally {
27+
await execute('hdiutil', ['detach', `/Volumes/${appName}`]);
28+
}
29+
30+
// see if the executable will run without being quarantined or similar
31+
await execute(`/Applications/${appName}.app/Contents/MacOS/${appName}`, [
32+
'--version',
33+
]);
34+
35+
if (process.env.HOME) {
36+
const settingsDir = path.resolve(
37+
process.env.HOME,
38+
'Library',
39+
'Application Support',
40+
appName
41+
);
42+
43+
if (existsSync(settingsDir)) {
44+
console.log(`${settingsDir} already exists. Removing.`);
45+
await execute('rm', ['-rf', settingsDir]);
46+
}
47+
}
48+
49+
return Promise.resolve({
50+
appName,
51+
appPath: `/Applications/${appName}.app`,
52+
});
53+
}

0 commit comments

Comments
 (0)