Skip to content

Commit 8f1cd9f

Browse files
authored
chore(e2e): refactor context to use yargs parser (#6398)
1 parent 953769b commit 8f1cd9f

17 files changed

+562
-253
lines changed

.depalignrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
],
2727
"js-yaml": [
2828
"^3.13.1"
29+
],
30+
"yargs": [
31+
"^4.8.1"
2932
]
3033
}
3134
}

.evergreen/functions.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,9 @@ functions:
597597
DEBUG: ${debug|}
598598
MONGODB_VERSION: ${mongodb_version|}
599599
MONGODB_RUNNER_VERSION: ${mongodb_version|}
600-
E2E_TEST_GROUPS: ${e2e_test_groups}
601-
E2E_TEST_GROUP: ${e2e_test_group}
600+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
601+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
602602
ATLAS_LOCAL_VERSION: latest
603-
HADRON_DISTRIBUTION: compass
604603
script: |
605604
set -e
606605
# Load environment variables
@@ -629,8 +628,8 @@ functions:
629628
DEBUG: ${debug|}
630629
MONGODB_VERSION: ${mongodb_version|}
631630
MONGODB_RUNNER_VERSION: ${mongodb_version|}
632-
E2E_TEST_GROUPS: ${e2e_test_groups}
633-
E2E_TEST_GROUP: ${e2e_test_group}
631+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
632+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
634633
script: |
635634
set -e
636635
# Load environment variables
@@ -664,14 +663,14 @@ functions:
664663
DEBUG: ${debug|}
665664
MONGODB_VERSION: ${mongodb_version|}
666665
MONGODB_RUNNER_VERSION: ${mongodb_version|}
667-
COMPASS_WEB_BROWSER_NAME: ${browser_name}
668-
E2E_TEST_GROUPS: ${e2e_test_groups}
669-
E2E_TEST_GROUP: ${e2e_test_group}
666+
COMPASS_E2E_BROWSER_NAME: ${browser_name}
667+
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
668+
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
670669
script: |
671670
set -e
672671
# Load environment variables
673672
eval $(.evergreen/print-compass-env.sh)
674-
npm run --unsafe-perm --workspace compass-e2e-tests test-web
673+
npm run --unsafe-perm --workspace compass-e2e-tests test-ci web
675674
676675
test-connectivity:
677676
- command: shell.exec

package-lock.json

+142-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-e2e-tests/helpers/commands/connect-form.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import type { CompassBrowser } from '../compass-browser';
44
import * as Selectors from '../selectors';
55
import type { ConnectFormState } from '../connect-form-state';
66
import Debug from 'debug';
7-
import { DEFAULT_CONNECTIONS } from '../test-runner-context';
7+
import {
8+
DEFAULT_CONNECTIONS,
9+
isTestingAtlasCloudExternal,
10+
} from '../test-runner-context';
811
import { getConnectionTitle } from '@mongodb-js/connection-info';
912
const debug = Debug('compass-e2e-tests');
1013

@@ -925,6 +928,12 @@ export async function saveConnection(
925928
}
926929

927930
export async function setupDefaultConnections(browser: CompassBrowser) {
931+
// When running tests against Atlas Cloud, connections can't be added or
932+
// removed from the UI manually, so we skip setup for default connections
933+
if (isTestingAtlasCloudExternal()) {
934+
return;
935+
}
936+
928937
/*
929938
This is intended to be used by most test files (ones that don't care too much
930939
about the intricacies about connections) in a before() hook after starting

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path';
22
import type { CompassBrowser } from '../compass-browser';
3-
import { LOG_SCREENSHOTS_PATH } from '../test-runner-context';
3+
import { LOG_SCREENSHOTS_PATH } from '../test-runner-paths';
44

55
const withTimeout = (millis: number, promise: Promise<any>) => {
66
let timeoutPid: NodeJS.Timeout;

0 commit comments

Comments
 (0)