Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into electron-32
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Oct 23, 2024
2 parents fe5897b + 8884e7f commit e1acdd0
Show file tree
Hide file tree
Showing 26 changed files with 743 additions and 996 deletions.
2 changes: 1 addition & 1 deletion .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ functions:
DEBUG: ${debug|}
MONGODB_VERSION: ${mongodb_version|}
MONGODB_RUNNER_VERSION: ${mongodb_version|}
BROWSER_NAME: ${browser_name}
COMPASS_WEB_BROWSER_NAME: ${browser_name}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
script: |
Expand Down
53 changes: 0 additions & 53 deletions .evergreen/node-gyp-bug-workaround.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .evergreen/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ if [ -n "$IS_WINDOWS" ]; then
./node.exe node_modules/npm2/bin/npm-cli.js i -g npm@$NPM_VERSION
rm -rf node_modules/npm2/
chmod +x npm.cmd npm

cd ..
.evergreen/node-gyp-bug-workaround.sh
else
if command -v ldd &> /dev/null && `ldd $(which bash) | grep 'libc.so' | awk '{print $3}'` | grep -Eq 'release version 2.(1|2[0-7])'; then
echo "Installing unofficial nodejs compiled for glibc 2.17 v${NODE_JS_VERSION} for ${PLATFORM} on ${ARCH}..."
Expand Down
19 changes: 11 additions & 8 deletions .evergreen/print-compass-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@ function printCompassEnv() {
}

if (process.env.PLATFORM === 'linux') {
// We generally require a relatively recent C++ compiler
// To build node modules on linux post electron 13 we need a newer c++
// compiler version and at least python v3.9, this adds it.
// https://jira.mongodb.org/browse/COMPASS-5150
pathsToPrepend.unshift('/opt/mongodbtoolchain/v4/bin');

// no Python 3.1x on ubuntu1604
pathsToPrepend.unshift('/opt/python/3.9/bin');
// node-gyp is tied to a specific Python version range
pathsToPrepend.unshift('/opt/python/3.12/bin');
}

PATH = maybePrependPaths(PATH, pathsToPrepend);
Expand Down Expand Up @@ -103,10 +100,16 @@ function printCompassEnv() {
printVar('IS_RHEL', process.env.IS_RHEL);
printVar('IS_UBUNTU', process.env.IS_UBUNTU);
printVar('DEBUG', process.env.DEBUG);
printVar('MONGODB_VERSION', process.env.MONGODB_VERSION || process.env.MONGODB_DEFAULT_VERSION);
printVar(
'MONGODB_VERSION',
process.env.MONGODB_VERSION || process.env.MONGODB_DEFAULT_VERSION
);
printVar('DEV_VERSION_IDENTIFIER', process.env.DEV_VERSION_IDENTIFIER);
printVar('EVERGREEN_REVISION', process.env.EVERGREEN_REVISION);
printVar('EVERGREEN_REVISION_ORDER_ID', process.env.EVERGREEN_REVISION_ORDER_ID);
printVar(
'EVERGREEN_REVISION_ORDER_ID',
process.env.EVERGREEN_REVISION_ORDER_ID
);

// https://jira.mongodb.org/browse/NODE-6320
printVar('GYP_DEFINES', `kerberos_use_rtld=${process.platform === 'linux'}`);
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ admin-token-bot <[email protected]>
Kræn Hansen <[email protected]>
Kræn Hansen <[email protected]>
Ruchitha Rajaghatta <[email protected]>
syn-zhu <[email protected]>
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The following third-party software is used by and included in **Mongodb Compass**.
This document was automatically generated on Tue Oct 22 2024.
This document was automatically generated on Wed Oct 23 2024.

## List of dependencies

Expand Down
2 changes: 1 addition & 1 deletion docs/tracking-plan.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Compass Tracking Plan

Generated on Tue, Oct 22, 2024 at 02:00 PM
Generated on Wed, Oct 23, 2024 at 11:59 AM

## Table of Contents

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"package-compass": "npm run package-compass --workspace=mongodb-compass --",
"package-compass-debug": "npm run package-compass-debug --workspace=mongodb-compass --",
"package-compass-nocompile": "npm run package-compass-nocompile --workspace=mongodb-compass --",
"prestart": "npm run compile --workspace=@mongodb-js/webpack-config-compass",
"prestart-web": "npm run prestart",
"start": "npm run start --workspace=mongodb-compass",
"start-web": "npm run start --workspace=@mongodb-js/compass-web",
"test": "lerna run test --concurrency 1 --stream",
Expand Down
7 changes: 5 additions & 2 deletions packages/compass-e2e-tests/.depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ ignores:
- '@mongodb-js/prettier-config-compass'
- '@mongodb-js/tsconfig-compass'
- '@wdio/types'
- 'mongodb-compass'
- 'ps-list'
- 'mongodb-runner'
# Avoiding recursive deps on monorepo workspaces
- 'mongodb-compass'
- '@mongodb-js/mocha-config-compass'
- 'compass-e2e-tests'
- '@mongodb-js/compass-web'
# TODO(COMPASS-8312): depcheck doesn't count this dependency because it's a
# types only import and the depcheck parser is resolving the @types/<name>
# package as a dep instead
Expand Down
2 changes: 0 additions & 2 deletions packages/compass-e2e-tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
.log
fixtures/*.csv
fixtures/*.json
write-electron-versions.js
electron-versions.json
4 changes: 0 additions & 4 deletions packages/compass-e2e-tests/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
fixtures
.nyc_output
coverage

# Generated files
electron-versions.json
write-electron-versions.js
71 changes: 16 additions & 55 deletions packages/compass-e2e-tests/helpers/commands/connect-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { expect } from 'chai';
import type { CompassBrowser } from '../compass-browser';
import * as Selectors from '../selectors';
import type { ConnectFormState } from '../connect-form-state';
import {
DEFAULT_CONNECTION_NAME_1,
DEFAULT_CONNECTION_NAME_2,
DEFAULT_CONNECTION_STRING_1,
DEFAULT_CONNECTION_STRING_2,
TEST_MULTIPLE_CONNECTIONS,
} from '../compass';
import { TEST_MULTIPLE_CONNECTIONS } from '../compass';
import Debug from 'debug';
import { DEFAULT_CONNECTIONS } from '../test-runner-context';
import { getConnectionTitle } from '@mongodb-js/connection-info';
const debug = Debug('compass-e2e-tests');

export async function resetConnectForm(browser: CompassBrowser): Promise<void> {
Expand Down Expand Up @@ -938,29 +934,13 @@ export async function setConnectFormState(

export async function saveConnection(
browser: CompassBrowser,
state: ConnectFormState,

// TODO(COMPASS-8023): Just remove these once the single connection code is removed
favouriteName: string,
color: string
state: ConnectFormState
): Promise<void> {
await browser.setConnectFormState(state);
if (TEST_MULTIPLE_CONNECTIONS) {
await browser.clickVisible(Selectors.ConnectionModalSaveButton);
await browser
.$(Selectors.ConnectionModal)
.waitForDisplayed({ reverse: true });
} else {
await browser.clickVisible(Selectors.ConnectionEditFavouriteButton);
await browser.$(Selectors.FavoriteModal).waitForDisplayed();
await browser.setValueVisible(Selectors.FavoriteNameInput, favouriteName);
await browser.clickVisible(
`${Selectors.FavoriteColorSelector} [data-testid="color-pick-${color}"]`
);
await browser.$(Selectors.FavoriteSaveButton).waitForEnabled();
await browser.clickVisible(Selectors.FavoriteSaveButton);
await browser.$(Selectors.FavoriteModal).waitForExist({ reverse: true });
}
await browser.clickVisible(Selectors.ConnectionModalSaveButton);
await browser
.$(Selectors.ConnectionModal)
.waitForDisplayed({ reverse: true });
}

export async function setupDefaultConnections(browser: CompassBrowser) {
Expand All @@ -986,39 +966,20 @@ export async function setupDefaultConnections(browser: CompassBrowser) {
whereas we do have some tests that try and use those. We can easily change
this in future if needed, though.
*/
for (const connectionName of [
DEFAULT_CONNECTION_NAME_1,
DEFAULT_CONNECTION_NAME_2,
]) {
for (const connectionInfo of DEFAULT_CONNECTIONS) {
const connectionName = getConnectionTitle(connectionInfo);
if (await browser.removeConnection(connectionName)) {
debug('Removing existing connection so we do not create a duplicate', {
connectionName,
});
}
}

await browser.saveConnection(
{
connectionString: DEFAULT_CONNECTION_STRING_1,
// NOTE: no connectionName, we're going with the auto-generated one. Also no
// connectionColor. Passing a name and colour for single connection world,
// though, because that's the only way to create a favourite.
},
DEFAULT_CONNECTION_NAME_1,
'color1'
);

// no need for a second connection in single connection mode
if (TEST_MULTIPLE_CONNECTIONS) {
await browser.saveConnection(
{
connectionString: DEFAULT_CONNECTION_STRING_2,
// NOTE: filling in a name so that this one does _not_ have the auto-generated one
connectionName: DEFAULT_CONNECTION_NAME_2,
connectionColor: 'Iris',
},
DEFAULT_CONNECTION_NAME_2,
'color8'
);
for (const connectionInfo of DEFAULT_CONNECTIONS) {
await browser.saveConnection({
connectionString: connectionInfo.connectionOptions.connectionString,
connectionName: connectionInfo.favorite?.name,
connectionColor: connectionInfo.favorite?.color,
});
}
}
4 changes: 2 additions & 2 deletions packages/compass-e2e-tests/helpers/commands/screenshot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import type { CompassBrowser } from '../compass-browser';
import { SCREENSHOTS_PATH } from '../compass';
import { LOG_SCREENSHOTS_PATH } from '../test-runner-context';

const withTimeout = (millis: number, promise: Promise<any>) => {
let timeoutPid: NodeJS.Timeout;
Expand All @@ -26,7 +26,7 @@ export async function screenshot(
// are still in progress or not.
await browser.pause(1000);

const fullPath = path.join(SCREENSHOTS_PATH, filename);
const fullPath = path.join(LOG_SCREENSHOTS_PATH, filename);
try {
await withTimeout(10000, browser.saveScreenshot(fullPath));
} catch (err: any) {
Expand Down
Loading

0 comments on commit e1acdd0

Please sign in to comment.