Skip to content

Commit de253a7

Browse files
feat(NODE-5908): support range v2 (#4141)
Co-authored-by: Aditi Khare <[email protected]>
1 parent 7295695 commit de253a7

File tree

113 files changed

+1050
-1550
lines changed

Some content is hidden

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

113 files changed

+1050
-1550
lines changed

.evergreen/config.in.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ functions:
272272
- command: shell.exec
273273
type: test
274274
params:
275+
shell: bash
275276
working_dir: src
276277
timeout_secs: 300
277278
script: |
@@ -475,8 +476,6 @@ functions:
475476
export AWS_CMK_ID='${AWS_CMK_ID}'
476477
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
477478
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
478-
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
479-
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
480479
EOT
481480
- command: shell.exec
482481
type: test
@@ -914,8 +913,6 @@ functions:
914913
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
915914
export AWS_REGION='${AWS_REGION}'
916915
export AWS_CMK_ID='${AWS_CMK_ID}'
917-
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
918-
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
919916
EOT
920917
- command: shell.exec
921918
type: test
@@ -1074,6 +1071,18 @@ functions:
10741071
args:
10751072
- ${PROJECT_DIRECTORY}/.evergreen/run-x509-tests.sh
10761073

1074+
install mongodb-client-encryption:
1075+
- command: subprocess.exec
1076+
type: setup
1077+
params:
1078+
working_dir: "src"
1079+
env:
1080+
INSTALL_DIR: mongodb-client-encryption
1081+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
1082+
binary: bash
1083+
args:
1084+
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
1085+
10771086
tasks:
10781087
- name: 'test-atlas-data-lake'
10791088
tags: ["datalake", "mongohouse"]

.evergreen/config.yml

+21-67
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ functions:
241241
- command: shell.exec
242242
type: test
243243
params:
244+
shell: bash
244245
working_dir: src
245246
timeout_secs: 300
246247
script: |
@@ -428,8 +429,6 @@ functions:
428429
export AWS_CMK_ID='${AWS_CMK_ID}'
429430
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
430431
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
431-
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
432-
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
433432
EOT
434433
- command: shell.exec
435434
type: test
@@ -886,8 +885,6 @@ functions:
886885
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
887886
export AWS_REGION='${AWS_REGION}'
888887
export AWS_CMK_ID='${AWS_CMK_ID}'
889-
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
890-
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
891888
EOT
892889
- command: shell.exec
893890
type: test
@@ -1035,6 +1032,17 @@ functions:
10351032
binary: bash
10361033
args:
10371034
- ${PROJECT_DIRECTORY}/.evergreen/run-x509-tests.sh
1035+
install mongodb-client-encryption:
1036+
- command: subprocess.exec
1037+
type: setup
1038+
params:
1039+
working_dir: src
1040+
env:
1041+
INSTALL_DIR: mongodb-client-encryption
1042+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
1043+
binary: bash
1044+
args:
1045+
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
10381046
tasks:
10391047
- name: test-atlas-data-lake
10401048
tags:
@@ -3516,7 +3524,7 @@ tasks:
35163524
variant: '*'
35173525
status: '*'
35183526
patch_optional: true
3519-
- name: run-custom-csfle-tests-5.0-pinned-commit
3527+
- name: run-custom-csfle-tests-5.0
35203528
tags:
35213529
- run-custom-dependency-tests
35223530
commands:
@@ -3528,46 +3536,12 @@ tasks:
35283536
- {key: NPM_VERSION, value: '9'}
35293537
- {key: VERSION, value: '5.0'}
35303538
- {key: TOPOLOGY, value: replica_set}
3531-
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
3532-
- func: install dependencies
3533-
- func: bootstrap mongo-orchestration
3534-
- func: bootstrap kms servers
3535-
- func: run custom csfle tests
3536-
- name: run-custom-csfle-tests-5.0-master
3537-
tags:
3538-
- run-custom-dependency-tests
3539-
commands:
3540-
- command: expansions.update
3541-
type: setup
3542-
params:
3543-
updates:
3544-
- {key: NODE_LTS_VERSION, value: '16'}
3545-
- {key: NPM_VERSION, value: '9'}
3546-
- {key: VERSION, value: '5.0'}
3547-
- {key: TOPOLOGY, value: replica_set}
3548-
- {key: CSFLE_GIT_REF, value: master}
3549-
- func: install dependencies
3550-
- func: bootstrap mongo-orchestration
3551-
- func: bootstrap kms servers
3552-
- func: run custom csfle tests
3553-
- name: run-custom-csfle-tests-rapid-pinned-commit
3554-
tags:
3555-
- run-custom-dependency-tests
3556-
commands:
3557-
- command: expansions.update
3558-
type: setup
3559-
params:
3560-
updates:
3561-
- {key: NODE_LTS_VERSION, value: '16'}
3562-
- {key: NPM_VERSION, value: '9'}
3563-
- {key: VERSION, value: rapid}
3564-
- {key: TOPOLOGY, value: replica_set}
3565-
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
35663539
- func: install dependencies
35673540
- func: bootstrap mongo-orchestration
35683541
- func: bootstrap kms servers
3542+
- func: install mongodb-client-encryption
35693543
- func: run custom csfle tests
3570-
- name: run-custom-csfle-tests-rapid-master
3544+
- name: run-custom-csfle-tests-rapid
35713545
tags:
35723546
- run-custom-dependency-tests
35733547
commands:
@@ -3579,29 +3553,12 @@ tasks:
35793553
- {key: NPM_VERSION, value: '9'}
35803554
- {key: VERSION, value: rapid}
35813555
- {key: TOPOLOGY, value: replica_set}
3582-
- {key: CSFLE_GIT_REF, value: master}
3583-
- func: install dependencies
3584-
- func: bootstrap mongo-orchestration
3585-
- func: bootstrap kms servers
3586-
- func: run custom csfle tests
3587-
- name: run-custom-csfle-tests-latest-pinned-commit
3588-
tags:
3589-
- run-custom-dependency-tests
3590-
commands:
3591-
- command: expansions.update
3592-
type: setup
3593-
params:
3594-
updates:
3595-
- {key: NODE_LTS_VERSION, value: '16'}
3596-
- {key: NPM_VERSION, value: '9'}
3597-
- {key: VERSION, value: latest}
3598-
- {key: TOPOLOGY, value: replica_set}
3599-
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
36003556
- func: install dependencies
36013557
- func: bootstrap mongo-orchestration
36023558
- func: bootstrap kms servers
3559+
- func: install mongodb-client-encryption
36033560
- func: run custom csfle tests
3604-
- name: run-custom-csfle-tests-latest-master
3561+
- name: run-custom-csfle-tests-latest
36053562
tags:
36063563
- run-custom-dependency-tests
36073564
commands:
@@ -3613,10 +3570,10 @@ tasks:
36133570
- {key: NPM_VERSION, value: '9'}
36143571
- {key: VERSION, value: latest}
36153572
- {key: TOPOLOGY, value: replica_set}
3616-
- {key: CSFLE_GIT_REF, value: master}
36173573
- func: install dependencies
36183574
- func: bootstrap mongo-orchestration
36193575
- func: bootstrap kms servers
3576+
- func: install mongodb-client-encryption
36203577
- func: run custom csfle tests
36213578
- name: test-latest-driver-mongodb-client-encryption-6.0.0
36223579
tags:
@@ -5118,12 +5075,9 @@ buildvariants:
51185075
display_name: Custom Dependency Version Test
51195076
run_on: rhel80-large
51205077
tasks:
5121-
- run-custom-csfle-tests-5.0-pinned-commit
5122-
- run-custom-csfle-tests-5.0-master
5123-
- run-custom-csfle-tests-rapid-pinned-commit
5124-
- run-custom-csfle-tests-rapid-master
5125-
- run-custom-csfle-tests-latest-pinned-commit
5126-
- run-custom-csfle-tests-latest-master
5078+
- run-custom-csfle-tests-5.0
5079+
- run-custom-csfle-tests-rapid
5080+
- run-custom-csfle-tests-latest
51275081
- test-latest-driver-mongodb-client-encryption-6.0.0
51285082
- name: rhel8-test-serverless
51295083
display_name: Serverless Test

.evergreen/generate_evergreen_tasks.js

+21-26
Original file line numberDiff line numberDiff line change
@@ -579,33 +579,29 @@ BUILD_VARIANTS.push({
579579
tasks: ['test-atlas-data-lake']
580580
});
581581

582-
const oneOffFuncAsTasks = [];
583-
584-
const FLE_PINNED_COMMIT = '974a4614f8c1c3786e5e39fa63568d83f4f69ebd';
582+
const customDependencyTests = [];
585583

586584
for (const version of ['5.0', 'rapid', 'latest']) {
587-
for (const ref of [FLE_PINNED_COMMIT, 'master']) {
588-
oneOffFuncAsTasks.push({
589-
name: `run-custom-csfle-tests-${version}-${ref === 'master' ? ref : 'pinned-commit'}`,
590-
tags: ['run-custom-dependency-tests'],
591-
commands: [
592-
updateExpansions({
593-
NODE_LTS_VERSION: LOWEST_LTS,
594-
NPM_VERSION: 9,
595-
VERSION: version,
596-
TOPOLOGY: 'replica_set',
597-
CSFLE_GIT_REF: ref
598-
}),
599-
{ func: 'install dependencies' },
600-
{ func: 'bootstrap mongo-orchestration' },
601-
{ func: 'bootstrap kms servers' },
602-
{ func: 'run custom csfle tests' }
603-
]
604-
});
605-
}
585+
customDependencyTests.push({
586+
name: `run-custom-csfle-tests-${version}`,
587+
tags: ['run-custom-dependency-tests'],
588+
commands: [
589+
updateExpansions({
590+
NODE_LTS_VERSION: LOWEST_LTS,
591+
NPM_VERSION: 9,
592+
VERSION: version,
593+
TOPOLOGY: 'replica_set',
594+
}),
595+
{ func: 'install dependencies' },
596+
{ func: 'bootstrap mongo-orchestration' },
597+
{ func: 'bootstrap kms servers' },
598+
{ func: 'install mongodb-client-encryption' },
599+
{ func: 'run custom csfle tests' }
600+
]
601+
});
606602
}
607603

608-
oneOffFuncAsTasks.push({
604+
customDependencyTests.push({
609605
name: `test-latest-driver-mongodb-client-encryption-6.0.0`,
610606
tags: ['run-custom-dependency-tests'],
611607
commands: [
@@ -641,13 +637,13 @@ const coverageTask = {
641637
};
642638

643639
SINGLETON_TASKS.push(coverageTask);
644-
SINGLETON_TASKS.push(...oneOffFuncAsTasks);
640+
SINGLETON_TASKS.push(...customDependencyTests);
645641

646642
BUILD_VARIANTS.push({
647643
name: 'rhel8-custom-dependency-tests',
648644
display_name: 'Custom Dependency Version Test',
649645
run_on: DEFAULT_OS,
650-
tasks: oneOffFuncAsTasks.map(({ name }) => name)
646+
tasks: customDependencyTests.map(({ name }) => name)
651647
});
652648

653649
// special case for serverless testing
@@ -759,7 +755,6 @@ fileData.tasks = (fileData.tasks || [])
759755
.concat(AUTH_DISABLED_TASKS)
760756
.concat(AWS_LAMBDA_HANDLER_TASKS)
761757
.concat(MONGOCRYPTD_CSFLE_TASKS);
762-
763758
fileData.buildvariants = (fileData.buildvariants || []).concat(BUILD_VARIANTS);
764759

765760
fs.writeFileSync(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! /usr/bin/env bash
2+
set +o xtrace # Do not write AWS credentials to stderr
3+
4+
# Initial checks for running these tests
5+
if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi
6+
7+
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"
8+
9+
set -o xtrace # Write all commands first to stderr
10+
set -o errexit # Exit the script with error if any of the commands fail
11+
12+
rm -rf $INSTALL_DIR
13+
git clone https://github.com/mongodb-js/mongodb-client-encryption.git
14+
pushd mongodb-client-encryption
15+
16+
if [ -n "${LIBMONGOCRYPT_VERSION}" ]; then
17+
# nightly tests test with `latest` to test against the laster FLE build.
18+
npm run install:libmongocrypt -- --libVersion $LIBMONGOCRYPT_VERSION
19+
else
20+
# otherwise use whatever is specified in the package.json.
21+
npm run install:libmongocrypt
22+
fi
23+
24+
echo "finished installing libmongocrypt"
25+
BINDINGS_DIR=$(pwd)
26+
27+
popd
28+
29+
echo "linking mongodb-client-encrytion"
30+
npm link ./mongodb-client-encryption

.evergreen/run-custom-csfle-tests.sh

-42
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,6 @@ echo "adding temporary AWS credentials to environment"
2222
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
2323
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
2424

25-
ABS_PATH_TO_PATCH=$(pwd)
26-
27-
# Environment Variables:
28-
# CSFLE_GIT_REF - set the git reference to checkout for a custom CSFLE version
29-
# CDRIVER_GIT_REF - set the git reference to checkout for a custom CDRIVER version (this is for libbson)
30-
CSFLE_GIT_REF=${CSFLE_GIT_REF:-master}
31-
CDRIVER_GIT_REF=${CDRIVER_GIT_REF:-1.17.6}
32-
33-
rm -rf ../csfle-deps-tmp
34-
mkdir -p ../csfle-deps-tmp
35-
pushd ../csfle-deps-tmp
36-
37-
rm -rf libmongocrypt mongo-c-driver
38-
39-
git clone https://github.com/mongodb/libmongocrypt.git
40-
pushd libmongocrypt
41-
git fetch --tags
42-
git checkout "$CSFLE_GIT_REF" -b csfle-custom
43-
echo "checked out libmongocrypt at $(git rev-parse HEAD)"
44-
popd # libmongocrypt
45-
46-
git clone https://github.com/mongodb/mongo-c-driver.git
47-
pushd mongo-c-driver
48-
git fetch --tags
49-
git checkout "$CDRIVER_GIT_REF" -b cdriver-custom
50-
echo "checked out C driver at $(git rev-parse HEAD)"
51-
popd # mongo-c-driver
52-
53-
pushd libmongocrypt/bindings/node
54-
55-
npm install --production --ignore-scripts
56-
bash ./etc/build-static.sh
57-
58-
npm run rebuild # just in case this is necessary?
59-
60-
BINDINGS_DIR=$(pwd)
61-
popd # libmongocrypt/bindings/node
62-
popd # ../csfle-deps-tmp
63-
64-
# copy mongodb-client-encryption into driver's node_modules
65-
npm link $BINDINGS_DIR
66-
6725
export MONGODB_URI=${MONGODB_URI}
6826
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
6927
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"

0 commit comments

Comments
 (0)