Skip to content

Commit 91589cc

Browse files
test: connect with FLE and local kms in e2e tests COMPASS-5832 (#3115)
* test: setup a connection with FLE and local kms in e2e tests COMPASS-5832 * refactor: set type string * refactor: reformat * test: update expected results * test: query by replica set selectors * refactor: reformat * test: update-evergreen-config * build: use rc server version * test: try with manual rc string * test: update evergreen template * test: quote env vars on evergreen * fix: remove special char to fix semver * refactor: reformat * test: set fle flag for test * test: print debug info * test: enterprise yes * test: fix agg port
1 parent 7ba6b3a commit 91589cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+374
-228
lines changed

.evergreen/buildvariants.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ buildvariants:
6464
- name: test-packaged-app-44x-enterprise
6565
- name: test-packaged-app-5x-community
6666
- name: test-packaged-app-5x-enterprise
67+
- name: test-packaged-app-60x-enterprise
6768

6869
- name: ubuntu
6970
display_name: Ubuntu (Test and Package)
@@ -100,3 +101,4 @@ buildvariants:
100101
- name: test-packaged-app-44x-enterprise
101102
- name: test-packaged-app-5x-community
102103
- name: test-packaged-app-5x-enterprise
104+
- name: test-packaged-app-60x-enterprise

.evergreen/functions.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ functions:
200200
# debugging any issues with tests. Set to "mocha*", "hadron*", or
201201
# "mongo*" for some helpful output from the test tooling we are using
202202
DEBUG=${debug} \
203-
MONGODB_VERSION=${mongodb_version|4.4.x} \
204-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
203+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
204+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
205205
npm run --unsafe-perm test-ci -- --stream --ignore="$IGNORE_TESTS"
206206
207207
test-electron:
@@ -225,8 +225,8 @@ functions:
225225
npm run --unsafe-perm electron-rebuild
226226
227227
DEBUG=${debug} \
228-
MONGODB_VERSION=${mongodb_version|4.4.x} \
229-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
228+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
229+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
230230
npm run --unsafe-perm test-ci-electron -- --stream
231231
232232
apply-compass-target-expansion:
@@ -335,8 +335,8 @@ functions:
335335
336336
337337
DEBUG=${debug} \
338-
MONGODB_VERSION=${mongodb_version|4.4.x} \
339-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
338+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
339+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
340340
npm run --unsafe-perm --workspace compass-e2e-tests test-ci
341341
342342
test-packaged-app:
@@ -359,8 +359,8 @@ functions:
359359
echo "Running tests against packaged app at $COMPASS_APP_PATH..."
360360
361361
DEBUG=${debug} \
362-
MONGODB_VERSION=${mongodb_version|4.4.x} \
363-
MONGODB_USE_ENTERPRISE=${mongodb_use_enterprise|} \
362+
MONGODB_VERSION="${mongodb_version|4.4.x}" \
363+
MONGODB_USE_ENTERPRISE="${mongodb_use_enterprise|}" \
364364
npm run --unsafe-perm --workspace compass-e2e-tests test-packaged-ci
365365
366366
test-connectivity:

.evergreen/tasks.in.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ tasks:
295295
compass_distribution: compass
296296
- func: test-packaged-app
297297
vars: <% for (const [key, value] of Object.entries(task['test-packaged-app'].vars)) { %>
298-
<% out(`${key}: ${value}`) } %>
298+
<% out(`${key}: '${value}'`) } %>
299299
compass_distribution: compass
300300
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
301301
<% } %>

.evergreen/tasks.yml

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ tasks:
275275
target_platform: '--platform=darwin'
276276

277277
# copied as test-packaged-app-macos due to depends_on variation
278-
278+
279279

280280
- name: test-packaged-app-40x-community
281281
tags: ['required-for-publish', 'run-on-pr']
@@ -294,11 +294,11 @@ tasks:
294294
vars:
295295
compass_distribution: compass
296296
- func: test-packaged-app
297-
vars:
298-
mongodb_version: 4.0.x
297+
vars:
298+
mongodb_version: '4.0.x'
299299
compass_distribution: compass
300300
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
301-
301+
302302

303303
- name: test-packaged-app-40x-enterprise
304304
tags: ['required-for-publish', 'run-on-pr']
@@ -317,12 +317,12 @@ tasks:
317317
vars:
318318
compass_distribution: compass
319319
- func: test-packaged-app
320-
vars:
321-
mongodb_version: 4.0.x
322-
mongodb_use_enterprise: yes
320+
vars:
321+
mongodb_version: '4.0.x'
322+
mongodb_use_enterprise: 'yes'
323323
compass_distribution: compass
324324
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
325-
325+
326326

327327
- name: test-packaged-app-42x-community
328328
tags: ['required-for-publish', 'run-on-pr']
@@ -341,11 +341,11 @@ tasks:
341341
vars:
342342
compass_distribution: compass
343343
- func: test-packaged-app
344-
vars:
345-
mongodb_version: 4.2.x
344+
vars:
345+
mongodb_version: '4.2.x'
346346
compass_distribution: compass
347347
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
348-
348+
349349

350350
- name: test-packaged-app-42x-enterprise
351351
tags: ['required-for-publish', 'run-on-pr']
@@ -364,12 +364,12 @@ tasks:
364364
vars:
365365
compass_distribution: compass
366366
- func: test-packaged-app
367-
vars:
368-
mongodb_version: 4.2.x
369-
mongodb_use_enterprise: yes
367+
vars:
368+
mongodb_version: '4.2.x'
369+
mongodb_use_enterprise: 'yes'
370370
compass_distribution: compass
371371
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
372-
372+
373373

374374
- name: test-packaged-app-44x-community
375375
tags: ['required-for-publish', 'run-on-pr']
@@ -388,11 +388,11 @@ tasks:
388388
vars:
389389
compass_distribution: compass
390390
- func: test-packaged-app
391-
vars:
392-
mongodb_version: 4.4.x
391+
vars:
392+
mongodb_version: '4.4.x'
393393
compass_distribution: compass
394394
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
395-
395+
396396

397397
- name: test-packaged-app-44x-enterprise
398398
tags: ['required-for-publish', 'run-on-pr']
@@ -411,12 +411,12 @@ tasks:
411411
vars:
412412
compass_distribution: compass
413413
- func: test-packaged-app
414-
vars:
415-
mongodb_version: 4.4.x
416-
mongodb_use_enterprise: yes
414+
vars:
415+
mongodb_version: '4.4.x'
416+
mongodb_use_enterprise: 'yes'
417417
compass_distribution: compass
418418
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
419-
419+
420420

421421
- name: test-packaged-app-5x-community
422422
tags: ['required-for-publish', 'run-on-pr']
@@ -435,11 +435,11 @@ tasks:
435435
vars:
436436
compass_distribution: compass
437437
- func: test-packaged-app
438-
vars:
439-
mongodb_version: 5.x.x
438+
vars:
439+
mongodb_version: '5.x.x'
440440
compass_distribution: compass
441441
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
442-
442+
443443

444444
- name: test-packaged-app-5x-enterprise
445445
tags: ['required-for-publish', 'run-on-pr']
@@ -458,9 +458,33 @@ tasks:
458458
vars:
459459
compass_distribution: compass
460460
- func: test-packaged-app
461-
vars:
462-
mongodb_version: 5.x.x
463-
mongodb_use_enterprise: yes
461+
vars:
462+
mongodb_version: '5.x.x'
463+
mongodb_use_enterprise: 'yes'
464464
compass_distribution: compass
465465
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
466+
466467

468+
- name: test-packaged-app-60x-enterprise
469+
tags: ['required-for-publish', 'run-on-pr']
470+
depends_on:
471+
- name: package
472+
commands:
473+
- func: prepare
474+
- func: install
475+
- func: bootstrap
476+
vars:
477+
scope: 'compass-e2e-tests'
478+
- func: apply-compass-target-expansion
479+
vars:
480+
compass_distribution: compass
481+
- func: get-packaged-app
482+
vars:
483+
compass_distribution: compass
484+
- func: test-packaged-app
485+
vars:
486+
mongodb_version: '>6.0.0-rc0'
487+
mongodb_use_enterprise: 'yes'
488+
compass_distribution: compass
489+
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
490+

.evergreen/template-yml.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ const testPackagedAppVariations = [
100100
mongodb_use_enterprise: 'yes'
101101
}
102102
}
103+
},
104+
{
105+
name: 'test-packaged-app-60x-enterprise',
106+
'test-packaged-app': {
107+
vars: {
108+
mongodb_version: '>6.0.0-rc0',
109+
mongodb_use_enterprise: 'yes'
110+
}
111+
}
103112
}
104113
];
105114

@@ -127,7 +136,10 @@ for (const buildVariant of buildVariants) {
127136
// TODO: The version of ubuntu we're using is not supported by mongodb 5 so
128137
// for now skip mongodb 5 on ubuntu. We'll upgrade (hopefully) soon and then
129138
// we can remove this.
130-
if (task.name.startsWith('test-packaged-app-5x') && buildVariant.name === 'ubuntu') {
139+
if (
140+
(task.name.startsWith('test-packaged-app-5x') || task.name.startsWith('test-packaged-app-60x')) &&
141+
buildVariant.name === 'ubuntu'
142+
) {
131143
continue;
132144
}
133145
buildVariant.tasks.push(task);

packages/compass-deployment-awareness/src/components/replica-set.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class ReplicaSet extends React.Component {
3939
return (
4040
<div
4141
className={classnames(styles['topology-replica-set-host-address'])}
42+
data-test-id={`topology-replica-set-host-address-${i}`}
4243
key={i}
4344
title={server.address}>
4445
{server.address}
@@ -65,7 +66,10 @@ class ReplicaSet extends React.Component {
6566
<div className={classnames(styles['topology-replica-set-cluster-title'])}>
6667
CLUSTER
6768
</div>
68-
<div className={classnames(styles['topology-replica-set-cluster-name'])}>
69+
<div
70+
className={classnames(styles['topology-replica-set-cluster-name'])}
71+
data-test-id="topology-replica-set-type"
72+
>
6973
Replica Set ({this.props.setName})
7074
</div>
7175
<div className={classnames(styles['topology-replica-set-cluster-nodes'])}>

packages/compass-deployment-awareness/src/components/sharded.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Sharded extends React.Component {
3737
return (
3838
<div
3939
className={classnames(styles['topology-sharded-host-address'])}
40+
data-test-id={`topology-sharded-host-address-${i}`}
4041
key={i}
4142
title={server.address}>
4243
{server.address}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { CompassBrowser } from '../compass-browser';
2+
3+
export async function expandAccordion(
4+
browser: CompassBrowser,
5+
selector: string
6+
): Promise<boolean> {
7+
const expandButton = await browser.$(selector);
8+
await expandButton.waitForDisplayed();
9+
10+
if ((await expandButton.getAttribute('aria-expanded')) === 'false') {
11+
await expandButton.click();
12+
await browser.waitUntil(async () => {
13+
return (await expandButton.getAttribute('aria-expanded')) === 'true';
14+
});
15+
return false; // it was collapsed and had to expand
16+
}
17+
18+
return true; // it was expanded already
19+
}

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

Lines changed: 0 additions & 19 deletions
This file was deleted.

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import type { ConnectFormState } from '../connect-form-state';
55
export async function getConnectFormState(
66
browser: CompassBrowser
77
): Promise<ConnectFormState> {
8-
const wasExpanded = await browser.expandConnectFormOptions();
8+
const wasExpanded = await browser.expandAccordion(
9+
Selectors.ShowConnectionFormButton
10+
);
911

1012
const connectionString = await browser
1113
.$(Selectors.ConnectionStringInput)
1214
.getValue();
1315

1416
// General
15-
const initialTab = await browser.navigateToConnecTab('General');
17+
const initialTab = await browser.navigateToConnectTab('General');
1618

1719
const defaultState = await promiseMap({
1820
scheme: getCheckedRadioValue(browser, Selectors.ConnectionFormSchemeRadios),
@@ -24,7 +26,7 @@ export async function getConnectFormState(
2426
});
2527

2628
// Authentication
27-
await browser.navigateToConnecTab('Authentication');
29+
await browser.navigateToConnectTab('Authentication');
2830
const authenticationState = await promiseMap({
2931
authMethod: getCheckedRadioValue(
3032
browser,
@@ -89,7 +91,7 @@ export async function getConnectFormState(
8991
});
9092

9193
// TLS/SSL
92-
await browser.navigateToConnecTab('TLS/SSL');
94+
await browser.navigateToConnectTab('TLS/SSL');
9395
const tlsState = await promiseMap({
9496
sslConnection: getCheckedRadioValue(
9597
browser,
@@ -125,8 +127,8 @@ export async function getConnectFormState(
125127
),
126128
});
127129

128-
// Proxy/SSH Tunnel
129-
await browser.navigateToConnecTab('Proxy/SSH Tunnel');
130+
// Proxy/SSH
131+
await browser.navigateToConnectTab('Proxy/SSH');
130132

131133
const proxyState = await promiseMap({
132134
proxyMethod: getCheckedRadioValue(
@@ -190,7 +192,7 @@ export async function getConnectFormState(
190192
});
191193

192194
// Advanced
193-
await browser.navigateToConnecTab('Advanced');
195+
await browser.navigateToConnectTab('Advanced');
194196
const advancedState = await promiseMap({
195197
readPreference: getCheckedRadioValue(
196198
browser,
@@ -235,7 +237,7 @@ export async function getConnectFormState(
235237
// restore the initial state
236238
if (wasExpanded) {
237239
// get back to the tab it was on
238-
await browser.navigateToConnecTab(initialTab);
240+
await browser.navigateToConnectTab(initialTab);
239241
} else {
240242
// collapse it again
241243
await browser.clickVisible(Selectors.ShowConnectionFormButton);

0 commit comments

Comments
 (0)