Skip to content

Commit fea2248

Browse files
authored
Merge branch 'main' into NODE-5265
2 parents 8c45368 + da12eb9 commit fea2248

File tree

4 files changed

+327
-95
lines changed

4 files changed

+327
-95
lines changed

.evergreen/config.in.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ functions:
191191
if [ -n "${CLIENT_ENCRYPTION}" ]; then
192192
cat <<EOT > prepare_client_encryption.sh
193193
export CLIENT_ENCRYPTION=${CLIENT_ENCRYPTION}
194+
export RUN_WITH_MONGOCRYPTD=${RUN_WITH_MONGOCRYPTD}
194195
export CSFLE_KMS_PROVIDERS='${CSFLE_KMS_PROVIDERS}'
195196
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
196197
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
@@ -218,10 +219,15 @@ functions:
218219
export VERSION=${VERSION}
219220
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
220221
221-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
222-
223-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
222+
if [ -z "${RUN_WITH_MONGOCRYPTD}" ]; then
223+
# Set up crypt shared lib if we don't want to use mongocryptd
224+
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
225+
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
226+
else
227+
echo "CRYPT_SHARED_LIB_PATH not set; using mongocryptd"
228+
fi
224229
230+
TEST_NPM_SCRIPT="${TEST_NPM_SCRIPT|check:integration-coverage}" \
225231
MONGODB_URI="${MONGODB_URI}" \
226232
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
227233
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \

.evergreen/config.yml

Lines changed: 144 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ functions:
160160
if [ -n "${CLIENT_ENCRYPTION}" ]; then
161161
cat <<EOT > prepare_client_encryption.sh
162162
export CLIENT_ENCRYPTION=${CLIENT_ENCRYPTION}
163+
export RUN_WITH_MONGOCRYPTD=${RUN_WITH_MONGOCRYPTD}
163164
export CSFLE_KMS_PROVIDERS='${CSFLE_KMS_PROVIDERS}'
164165
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
165166
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
@@ -187,10 +188,15 @@ functions:
187188
export VERSION=${VERSION}
188189
export DRIVERS_TOOLS=${DRIVERS_TOOLS}
189190
190-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
191-
192-
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
191+
if [ -z "${RUN_WITH_MONGOCRYPTD}" ]; then
192+
# Set up crypt shared lib if we don't want to use mongocryptd
193+
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
194+
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
195+
else
196+
echo "CRYPT_SHARED_LIB_PATH not set; using mongocryptd"
197+
fi
193198
199+
TEST_NPM_SCRIPT="${TEST_NPM_SCRIPT|check:integration-coverage}" \
194200
MONGODB_URI="${MONGODB_URI}" \
195201
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
196202
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
@@ -3084,6 +3090,111 @@ tasks:
30843090
- func: add aws auth variables to file
30853091
- func: setup aws env
30863092
- func: run lambda handler example tests with aws auth
3093+
- name: test-latest-csfle-mongocryptd
3094+
tags:
3095+
- latest
3096+
- sharded_cluster
3097+
commands:
3098+
- func: install dependencies
3099+
- func: bootstrap mongo-orchestration
3100+
vars:
3101+
VERSION: latest
3102+
TOPOLOGY: sharded_cluster
3103+
AUTH: auth
3104+
- func: bootstrap kms servers
3105+
- func: run tests
3106+
vars:
3107+
TEST_NPM_SCRIPT: check:csfle
3108+
- name: test-rapid-csfle-mongocryptd
3109+
tags:
3110+
- rapid
3111+
- sharded_cluster
3112+
commands:
3113+
- func: install dependencies
3114+
- func: bootstrap mongo-orchestration
3115+
vars:
3116+
VERSION: rapid
3117+
TOPOLOGY: sharded_cluster
3118+
AUTH: auth
3119+
- func: bootstrap kms servers
3120+
- func: run tests
3121+
vars:
3122+
TEST_NPM_SCRIPT: check:csfle
3123+
- name: test-7.0-csfle-mongocryptd
3124+
tags:
3125+
- '7.0'
3126+
- sharded_cluster
3127+
commands:
3128+
- func: install dependencies
3129+
- func: bootstrap mongo-orchestration
3130+
vars:
3131+
VERSION: '7.0'
3132+
TOPOLOGY: sharded_cluster
3133+
AUTH: auth
3134+
- func: bootstrap kms servers
3135+
- func: run tests
3136+
vars:
3137+
TEST_NPM_SCRIPT: check:csfle
3138+
- name: test-6.0-csfle-mongocryptd
3139+
tags:
3140+
- '6.0'
3141+
- sharded_cluster
3142+
commands:
3143+
- func: install dependencies
3144+
- func: bootstrap mongo-orchestration
3145+
vars:
3146+
VERSION: '6.0'
3147+
TOPOLOGY: sharded_cluster
3148+
AUTH: auth
3149+
- func: bootstrap kms servers
3150+
- func: run tests
3151+
vars:
3152+
TEST_NPM_SCRIPT: check:csfle
3153+
- name: test-5.0-csfle-mongocryptd
3154+
tags:
3155+
- '5.0'
3156+
- sharded_cluster
3157+
commands:
3158+
- func: install dependencies
3159+
- func: bootstrap mongo-orchestration
3160+
vars:
3161+
VERSION: '5.0'
3162+
TOPOLOGY: sharded_cluster
3163+
AUTH: auth
3164+
- func: bootstrap kms servers
3165+
- func: run tests
3166+
vars:
3167+
TEST_NPM_SCRIPT: check:csfle
3168+
- name: test-4.4-csfle-mongocryptd
3169+
tags:
3170+
- '4.4'
3171+
- sharded_cluster
3172+
commands:
3173+
- func: install dependencies
3174+
- func: bootstrap mongo-orchestration
3175+
vars:
3176+
VERSION: '4.4'
3177+
TOPOLOGY: sharded_cluster
3178+
AUTH: auth
3179+
- func: bootstrap kms servers
3180+
- func: run tests
3181+
vars:
3182+
TEST_NPM_SCRIPT: check:csfle
3183+
- name: test-4.2-csfle-mongocryptd
3184+
tags:
3185+
- '4.2'
3186+
- sharded_cluster
3187+
commands:
3188+
- func: install dependencies
3189+
- func: bootstrap mongo-orchestration
3190+
vars:
3191+
VERSION: '4.2'
3192+
TOPOLOGY: sharded_cluster
3193+
AUTH: auth
3194+
- func: bootstrap kms servers
3195+
- func: run tests
3196+
vars:
3197+
TEST_NPM_SCRIPT: check:csfle
30873198
- name: run-mongosh-browser-repl
30883199
tags:
30893200
- run-mongosh-integration-tests
@@ -3672,6 +3783,36 @@ buildvariants:
36723783
- test-tls-support-5.0
36733784
- test-tls-support-4.4
36743785
- test-tls-support-4.2
3786+
- name: rhel8-node14-test-csfle-mongocryptd
3787+
display_name: rhel 8 Node14 test mongocryptd
3788+
run_on: rhel80-large
3789+
expansions:
3790+
CLIENT_ENCRYPTION: true
3791+
RUN_WITH_MONGOCRYPTD: true
3792+
NODE_LTS_VERSION: 14
3793+
tasks:
3794+
- test-latest-csfle-mongocryptd
3795+
- test-rapid-csfle-mongocryptd
3796+
- test-7.0-csfle-mongocryptd
3797+
- test-6.0-csfle-mongocryptd
3798+
- test-5.0-csfle-mongocryptd
3799+
- test-4.4-csfle-mongocryptd
3800+
- test-4.2-csfle-mongocryptd
3801+
- name: rhel8-node20-test-csfle-mongocryptd
3802+
display_name: rhel 8 Node20 test mongocryptd
3803+
run_on: rhel80-large
3804+
expansions:
3805+
CLIENT_ENCRYPTION: true
3806+
RUN_WITH_MONGOCRYPTD: true
3807+
NODE_LTS_VERSION: 14
3808+
tasks:
3809+
- test-latest-csfle-mongocryptd
3810+
- test-rapid-csfle-mongocryptd
3811+
- test-7.0-csfle-mongocryptd
3812+
- test-6.0-csfle-mongocryptd
3813+
- test-5.0-csfle-mongocryptd
3814+
- test-4.4-csfle-mongocryptd
3815+
- test-4.2-csfle-mongocryptd
36753816
- name: macos-1100
36763817
display_name: MacOS 11 Node20
36773818
run_on: macos-1100

.evergreen/generate_evergreen_tasks.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require('fs');
22
const yaml = require('js-yaml');
3+
const semver = require('semver');
34
const { mongoshTasks } = require('./generate_mongosh_tasks');
45

56
const {
@@ -463,6 +464,52 @@ for (const {
463464
}
464465
}
465466

467+
// Running CSFLE tests with mongocryptd
468+
const MONGOCRYPTD_CSFLE_TASKS = MONGODB_VERSIONS
469+
.filter(mongoVersion => ['latest', 'rapid'].includes(mongoVersion)
470+
|| semver.gte(`${mongoVersion}.0`, '4.2.0'))
471+
.map((mongoVersion) => {
472+
return {
473+
name: `test-${mongoVersion}-csfle-mongocryptd`,
474+
tags: [mongoVersion, 'sharded_cluster'],
475+
commands: [
476+
{ func: 'install dependencies' },
477+
{
478+
func: 'bootstrap mongo-orchestration',
479+
vars: {
480+
VERSION: mongoVersion,
481+
TOPOLOGY: 'sharded_cluster',
482+
AUTH: 'auth'
483+
}
484+
},
485+
{ func: 'bootstrap kms servers' },
486+
{
487+
func: 'run tests',
488+
vars: {
489+
TEST_NPM_SCRIPT: 'check:csfle'
490+
}
491+
}
492+
]
493+
}
494+
});
495+
496+
for (const nodeVersion of [LOWEST_LTS, LATEST_LTS]) {
497+
const name = `rhel8-node${nodeVersion}-test-csfle-mongocryptd`;
498+
const displayName = `rhel 8 Node${nodeVersion} test mongocryptd`;
499+
BUILD_VARIANTS.push({
500+
name,
501+
display_name: displayName,
502+
run_on: DEFAULT_OS,
503+
expansions: {
504+
CLIENT_ENCRYPTION: true,
505+
RUN_WITH_MONGOCRYPTD: true,
506+
NODE_LTS_VERSION: LOWEST_LTS
507+
},
508+
tasks:
509+
MONGOCRYPTD_CSFLE_TASKS.map(task => task.name)
510+
});
511+
}
512+
466513
BUILD_VARIANTS.push({
467514
name: 'macos-1100',
468515
display_name: `MacOS 11 Node${LATEST_LTS}`,
@@ -732,6 +779,7 @@ fileData.tasks = (fileData.tasks || [])
732779
.concat(SINGLETON_TASKS)
733780
.concat(AUTH_DISABLED_TASKS)
734781
.concat(AWS_LAMBDA_HANDLER_TASKS)
782+
.concat(MONGOCRYPTD_CSFLE_TASKS)
735783
.concat(mongoshTasks);
736784

737785
fileData.buildvariants = (fileData.buildvariants || []).concat(BUILD_VARIANTS);

0 commit comments

Comments
 (0)