Skip to content

Commit

Permalink
chore(e2e): refactor context to use yargs parser (#6398)
Browse files Browse the repository at this point in the history
  • Loading branch information
gribnoysup authored Oct 28, 2024
1 parent 953769b commit 8f1cd9f
Show file tree
Hide file tree
Showing 17 changed files with 562 additions and 253 deletions.
3 changes: 3 additions & 0 deletions .depalignrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
],
"js-yaml": [
"^3.13.1"
],
"yargs": [
"^4.8.1"
]
}
}
17 changes: 8 additions & 9 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,9 @@ functions:
DEBUG: ${debug|}
MONGODB_VERSION: ${mongodb_version|}
MONGODB_RUNNER_VERSION: ${mongodb_version|}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
ATLAS_LOCAL_VERSION: latest
HADRON_DISTRIBUTION: compass
script: |
set -e
# Load environment variables
Expand Down Expand Up @@ -629,8 +628,8 @@ functions:
DEBUG: ${debug|}
MONGODB_VERSION: ${mongodb_version|}
MONGODB_RUNNER_VERSION: ${mongodb_version|}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
script: |
set -e
# Load environment variables
Expand Down Expand Up @@ -664,14 +663,14 @@ functions:
DEBUG: ${debug|}
MONGODB_VERSION: ${mongodb_version|}
MONGODB_RUNNER_VERSION: ${mongodb_version|}
COMPASS_WEB_BROWSER_NAME: ${browser_name}
E2E_TEST_GROUPS: ${e2e_test_groups}
E2E_TEST_GROUP: ${e2e_test_group}
COMPASS_E2E_BROWSER_NAME: ${browser_name}
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
script: |
set -e
# Load environment variables
eval $(.evergreen/print-compass-env.sh)
npm run --unsafe-perm --workspace compass-e2e-tests test-web
npm run --unsafe-perm --workspace compass-e2e-tests test-ci web
test-connectivity:
- command: shell.exec
Expand Down
144 changes: 142 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion packages/compass-e2e-tests/helpers/commands/connect-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import type { CompassBrowser } from '../compass-browser';
import * as Selectors from '../selectors';
import type { ConnectFormState } from '../connect-form-state';
import Debug from 'debug';
import { DEFAULT_CONNECTIONS } from '../test-runner-context';
import {
DEFAULT_CONNECTIONS,
isTestingAtlasCloudExternal,
} from '../test-runner-context';
import { getConnectionTitle } from '@mongodb-js/connection-info';
const debug = Debug('compass-e2e-tests');

Expand Down Expand Up @@ -925,6 +928,12 @@ export async function saveConnection(
}

export async function setupDefaultConnections(browser: CompassBrowser) {
// When running tests against Atlas Cloud, connections can't be added or
// removed from the UI manually, so we skip setup for default connections
if (isTestingAtlasCloudExternal()) {
return;
}

/*
This is intended to be used by most test files (ones that don't care too much
about the intricacies about connections) in a before() hook after starting
Expand Down
2 changes: 1 addition & 1 deletion 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 { LOG_SCREENSHOTS_PATH } from '../test-runner-context';
import { LOG_SCREENSHOTS_PATH } from '../test-runner-paths';

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

0 comments on commit 8f1cd9f

Please sign in to comment.