Skip to content

Commit 564b0d7

Browse files
authored
test(NODE-3606): legacy and new versions of the CSFLE library (#3002)
1 parent 7c5a7bb commit 564b0d7

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.evergreen/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ functions:
206206
script: |
207207
KRB5_KEYTAB='${gssapi_auth_keytab_base64}' KRB5_PRINCIPAL='${gssapi_auth_principal}' \
208208
MONGODB_URI='${gssapi_auth_mongodb_uri}' UNIFIED=${UNIFIED} \
209-
NODE_LTS_NAME='${NODE_LTS_NAME}' bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh
209+
NODE_LTS_NAME='${NODE_LTS_NAME}' NODE_VERSION=${NODE_VERSION} bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh
210210
run ldap tests:
211211
- command: shell.exec
212212
type: test

.evergreen/run-kerberos-tests.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ fi
2222
echo "Running kinit"
2323
kinit -k -t "$(pwd)/.evergreen/drivers.keytab" -p ${KRB5_PRINCIPAL}
2424

25-
npm install kerberos
25+
set -o xtrace
26+
if [ -z ${NODE_VERSION+omitted} ]; then echo "NODE_VERSION is unset" && exit 1; fi
27+
NODE_MAJOR_VERSION=$(echo "$NODE_VERSION" | cut -d. -f1)
28+
if [[ $NODE_MAJOR_VERSION -ge 12 ]]; then
29+
npm install kerberos@">=2.0.0-beta.0"
30+
else
31+
npm install kerberos@"^1.1.7"
32+
fi
33+
set +o xtrace
34+
2635
npm run check:kerberos
2736

2837
# destroy ticket

.evergreen/run-tests.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# set -o xtrace # Write all commands first to stderr
33
set -o errexit # Exit the script with error if any of the commands fail
44

@@ -52,8 +52,12 @@ if [[ -z "${CLIENT_ENCRYPTION}" ]]; then
5252
unset AWS_ACCESS_KEY_ID;
5353
unset AWS_SECRET_ACCESS_KEY;
5454
else
55-
npm install mongodb-client-encryption@latest
56-
55+
NODE_MAJOR_VERSION=$(echo $NODE_VERSION | cut -d. -f1)
56+
if [[ $NODE_MAJOR_VERSION -ge 12 ]]; then
57+
npm install mongodb-client-encryption@">=2.0.0-beta.0"
58+
else
59+
npm install mongodb-client-encryption@"^1.2.7"
60+
fi
5761
# Get access to the AWS temporary credentials:
5862
echo "adding temporary AWS credentials to environment"
5963
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN

0 commit comments

Comments
 (0)