Skip to content

Commit 0b1943f

Browse files
authored
chore(ci): also test against community server MONGOSH-542 (#705)
1 parent f2acfb3 commit 0b1943f

File tree

5 files changed

+177
-40
lines changed

5 files changed

+177
-40
lines changed

.evergreen.yml

Lines changed: 118 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ functions:
104104
105105
###
106106
# ARTIFACT COMPILATION
107-
#
107+
#
108108
# compile_artifact generates the executable binary and uploads it as TGZ to S3 for later use.
109109
# Use download_compiled_artifact to download the TGZ from S3.
110110
#
@@ -142,7 +142,7 @@ functions:
142142

143143
###
144144
# E2E TEST EXECUTION
145-
#
145+
#
146146
# Runs the E2E tests against the compiled artifact, i.e. expects the compiled artifact to be already present.
147147
###
148148
run_e2e_tests:
@@ -163,13 +163,13 @@ functions:
163163
# package_and_upload_artifact generates a distributable package out of the compiled artifact,
164164
# i.e. it expects it to have been downloaded already. The distributable package will be uploaded
165165
# to a specifc Evergreen S3 bucket for later use.
166-
#
166+
#
167167
# The URL to download the distributable package can be retrieved by get_artifact_url.
168168
#
169169
# package_and_upload_artifact expects the following arguments:
170170
# - distro_id
171171
# - distribution_build_variant
172-
#
172+
#
173173
# get_artifact_url expects the following arguments:
174174
# - distribution_build_variant
175175
###
@@ -356,8 +356,21 @@ tasks:
356356

357357
###
358358
# UNIT TESTS
359+
# E.g. test_m40xc_n12 stands for mongod 4.0.x, community edition, Node.js 12
359360
###
360-
- name: test_m40x_n12
361+
- name: test_m40xc_n12
362+
tags: ["unit-test"]
363+
commands:
364+
- func: checkout
365+
- func: install
366+
vars:
367+
node_js_version: "12.20.0"
368+
- func: test
369+
vars:
370+
mongosh_server_test_version: "4.0.x-community"
371+
node_js_version: "12.20.0"
372+
mongosh_skip_node_version_check: "1"
373+
- name: test_m40xe_n12
361374
tags: ["unit-test"]
362375
commands:
363376
- func: checkout
@@ -369,7 +382,19 @@ tasks:
369382
mongosh_server_test_version: "4.0.x"
370383
node_js_version: "12.20.0"
371384
mongosh_skip_node_version_check: "1"
372-
- name: test_m42x_n12
385+
- name: test_m42xc_n12
386+
tags: ["unit-test"]
387+
commands:
388+
- func: checkout
389+
- func: install
390+
vars:
391+
node_js_version: "12.20.0"
392+
- func: test
393+
vars:
394+
mongosh_server_test_version: "4.2.x-community"
395+
node_js_version: "12.20.0"
396+
mongosh_skip_node_version_check: "1"
397+
- name: test_m42xe_n12
373398
tags: ["unit-test"]
374399
commands:
375400
- func: checkout
@@ -381,7 +406,19 @@ tasks:
381406
mongosh_server_test_version: "4.2.x"
382407
node_js_version: "12.20.0"
383408
mongosh_skip_node_version_check: "1"
384-
- name: test_m44x_n12
409+
- name: test_m44xc_n12
410+
tags: ["unit-test"]
411+
commands:
412+
- func: checkout
413+
- func: install
414+
vars:
415+
node_js_version: "12.20.0"
416+
- func: test
417+
vars:
418+
mongosh_server_test_version: "4.4.x-community"
419+
node_js_version: "12.20.0"
420+
mongosh_skip_node_version_check: "1"
421+
- name: test_m44xe_n12
385422
tags: ["unit-test"]
386423
commands:
387424
- func: checkout
@@ -405,7 +442,18 @@ tasks:
405442
mongosh_server_test_version: "latest-alpha"
406443
node_js_version: "12.20.0"
407444
mongosh_skip_node_version_check: "1"
408-
- name: test_m40x_n14
445+
- name: test_m40xc_n14
446+
tags: ["unit-test"]
447+
commands:
448+
- func: checkout
449+
- func: install
450+
vars:
451+
node_js_version: "14.15.1"
452+
- func: test
453+
vars:
454+
mongosh_server_test_version: "4.0.x-community"
455+
node_js_version: "14.15.1"
456+
- name: test_m40xe_n14
409457
tags: ["unit-test"]
410458
commands:
411459
- func: checkout
@@ -416,7 +464,18 @@ tasks:
416464
vars:
417465
mongosh_server_test_version: "4.0.x"
418466
node_js_version: "14.15.1"
419-
- name: test_m42x_n14
467+
- name: test_m42xc_n14
468+
tags: ["unit-test"]
469+
commands:
470+
- func: checkout
471+
- func: install
472+
vars:
473+
node_js_version: "14.15.1"
474+
- func: test
475+
vars:
476+
mongosh_server_test_version: "4.2.x-community"
477+
node_js_version: "14.15.1"
478+
- name: test_m42xe_n14
420479
tags: ["unit-test"]
421480
commands:
422481
- func: checkout
@@ -427,7 +486,18 @@ tasks:
427486
vars:
428487
mongosh_server_test_version: "4.2.x"
429488
node_js_version: "14.15.1"
430-
- name: test_m44x_n14
489+
- name: test_m44xc_n14
490+
tags: ["unit-test"]
491+
commands:
492+
- func: checkout
493+
- func: install
494+
vars:
495+
node_js_version: "14.15.1"
496+
- func: test
497+
vars:
498+
mongosh_server_test_version: "4.4.x-community"
499+
node_js_version: "14.15.1"
500+
- name: test_m44xe_n14
431501
tags: ["unit-test"]
432502
commands:
433503
- func: checkout
@@ -636,7 +706,7 @@ tasks:
636706
vars:
637707
node_js_version: "14.15.1"
638708
distribution_build_variant: win32msi
639-
709+
640710
###
641711
# SMOKE TESTS
642712
###
@@ -767,7 +837,7 @@ tasks:
767837
source_distribution_build_variant: darwin
768838
- func: write_preload_script
769839
- func: test_artifact_macos
770-
840+
771841
###
772842
# RELEASE TASKS
773843
###
@@ -816,13 +886,19 @@ buildvariants:
816886
executable_os_id: darwin
817887
tasks:
818888
- name: check
819-
- name: test_m40x_n12
820-
- name: test_m42x_n12
821-
- name: test_m44x_n12
889+
- name: test_m40xc_n12
890+
- name: test_m40xe_n12
891+
- name: test_m42xc_n12
892+
- name: test_m42xe_n12
893+
- name: test_m44xc_n12
894+
- name: test_m44xe_n12
822895
- name: test_mlatest_n12
823-
- name: test_m40x_n14
824-
- name: test_m42x_n14
825-
- name: test_m44x_n14
896+
- name: test_m40xc_n14
897+
- name: test_m40xe_n14
898+
- name: test_m42xc_n14
899+
- name: test_m42xe_n14
900+
- name: test_m44xc_n14
901+
- name: test_m44xe_n14
826902
- name: test_mlatest_n14
827903
- name: compile_artifact
828904
- name: e2e_tests_darwin
@@ -834,13 +910,19 @@ buildvariants:
834910
executable_os_id: linux
835911
tasks:
836912
- name: check
837-
- name: test_m40x_n12
838-
- name: test_m42x_n12
839-
- name: test_m44x_n12
913+
- name: test_m40xc_n12
914+
- name: test_m40xe_n12
915+
- name: test_m42xc_n12
916+
- name: test_m42xe_n12
917+
- name: test_m44xc_n12
918+
- name: test_m44xe_n12
840919
- name: test_mlatest_n12
841-
- name: test_m40x_n14
842-
- name: test_m42x_n14
843-
- name: test_m44x_n14
920+
- name: test_m40xc_n14
921+
- name: test_m40xe_n14
922+
- name: test_m42xc_n14
923+
- name: test_m42xe_n14
924+
- name: test_m44xc_n14
925+
- name: test_m44xe_n14
844926
- name: test_mlatest_n14
845927
- name: test_vscode
846928
- name: test_connectivity
@@ -893,13 +975,19 @@ buildvariants:
893975
executable_os_id: win32
894976
tasks:
895977
- name: check
896-
- name: test_m40x_n12
897-
- name: test_m42x_n12
898-
- name: test_m44x_n12
978+
- name: test_m40xc_n12
979+
- name: test_m40xe_n12
980+
- name: test_m42xc_n12
981+
- name: test_m42xe_n12
982+
- name: test_m44xc_n12
983+
- name: test_m44xe_n12
899984
- name: test_mlatest_n12
900-
- name: test_m40x_n14
901-
- name: test_m42x_n14
902-
- name: test_m44x_n14
985+
- name: test_m40xc_n14
986+
- name: test_m40xe_n14
987+
- name: test_m42xc_n14
988+
- name: test_m42xe_n14
989+
- name: test_m44xc_n14
990+
- name: test_m44xe_n14
903991
- name: test_mlatest_n14
904992
- name: e2e_tests_win
905993
- name: package_and_upload_artifact_win

packages/build/src/download-mongodb.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ export async function downloadMongoDb(tmpdir: string, targetVersionSemverSpecifi
115115
return await doDownload(tmpdir, 'latest-alpha', () => lookupAlphaDownloadUrl());
116116
}
117117

118+
let wantsEnterprise = true;
119+
if (/-community$/.test(targetVersionSemverSpecifier)) {
120+
wantsEnterprise = false;
121+
targetVersionSemverSpecifier = targetVersionSemverSpecifier.replace(/-community$/, '');
122+
}
123+
118124
let fullJson: FullJSON;
119125
const fullJSONCachePath = path.resolve(tmpdir, 'full.json.gz');
120126
try {
@@ -130,7 +136,10 @@ export async function downloadMongoDb(tmpdir: string, targetVersionSemverSpecifi
130136
.filter((info: VersionInfo) => semver.satisfies(info.version, targetVersionSemverSpecifier))
131137
.sort((a: VersionInfo, b: VersionInfo) => semver.rcompare(a.version, b.version));
132138
const versionInfo: VersionInfo = productionVersions[0];
133-
return await doDownload(tmpdir, versionInfo.version, () => lookupDownloadUrl(versionInfo, true));
139+
return await doDownload(
140+
tmpdir,
141+
versionInfo.version + (wantsEnterprise ? '-enterprise' : '-community'),
142+
() => lookupDownloadUrl(versionInfo, wantsEnterprise));
134143
}
135144

136145
const downloadPromises: Record<string, Promise<string>> = {};

packages/cli-repl/src/smoke-tests-fle.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ try {
2020
} catch(err) {
2121
console.log(err);
2222
}
23-
if (db.version().startsWith('4.0.')) {
24-
// No FLE on mongod < 4.2
23+
if (db.version().startsWith('4.0.') ||
24+
!db.runCommand({buildInfo:1}).modules.includes('enterprise')) {
25+
// No FLE on mongod < 4.2 or community
2526
print('Test skipped')
2627
process.exit(0)
2728
}

packages/cli-repl/test/e2e-fle.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from 'chai';
22
import { MongoClient } from 'mongodb';
33
import { TestShell } from './test-shell';
4-
import { startTestServer, useBinaryPath, skipIfServerVersion } from '../../../testing/integration-testing-hooks';
4+
import { startTestServer, useBinaryPath, skipIfServerVersion, skipIfCommunityServer } from '../../../testing/integration-testing-hooks';
55
import { makeFakeHTTPServer, fakeAWSHandlers } from '../../../testing/fake-kms';
66
import { once } from 'events';
77
import { serialize } from 'v8';
@@ -11,6 +11,7 @@ import path from 'path';
1111
describe('FLE tests', () => {
1212
const testServer = startTestServer('shared');
1313
skipIfServerVersion(testServer, '< 4.2'); // FLE only available on 4.2+
14+
skipIfCommunityServer(testServer); // FLE is enterprise-only
1415
useBinaryPath(testServer); // Get mongocryptd in the PATH for this test
1516
let kmsServer: ReturnType<typeof makeFakeHTTPServer>;
1617
let dbname: string;

0 commit comments

Comments
 (0)