Skip to content

Commit aa069f1

Browse files
authored
chore(NODE-3719): spec compliance review wrap up (#3145)
1 parent b192493 commit aa069f1

13 files changed

+967
-847
lines changed

.evergreen/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ functions:
143143
fi
144144
145145
MONGODB_URI="${MONGODB_URI}" \
146-
AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} \
146+
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
147147
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
148148
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=${SKIP_DEPS|1} NO_EXIT=${NO_EXIT|1} \
149149
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
@@ -204,7 +204,6 @@ functions:
204204
MONGODB_URI="${MONGODB_URI}" \
205205
AUTH=${AUTH} \
206206
SSL=${SSL} \
207-
UNIFIED=${UNIFIED} \
208207
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
209208
NODE_VERSION=${NODE_VERSION} \
210209
SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" \
@@ -595,7 +594,6 @@ functions:
595594
script: |
596595
${PREPARE_SHELL}
597596
598-
UNIFIED=${UNIFIED} \
599597
CA_FILE="$DRIVERS_TOOLS/.evergreen/ocsp/rsa/ca.pem" \
600598
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
601599
bash ${PROJECT_DIRECTORY}/.evergreen/run-ocsp-tests.sh
@@ -2353,9 +2351,11 @@ buildvariants:
23532351
NODE_LTS_NAME: erbium
23542352
tasks:
23552353
- serverless_task_group
2356-
- name: no-auth-tests
2354+
- name: ubuntu1804-no-auth-tests
23572355
display_name: No Auth Tests
2358-
run_on: ubuntu1804-test
2356+
run_on: ubuntu1804-large
2357+
expansions:
2358+
CLIENT_ENCRYPTION: true
23592359
tasks:
23602360
- test-latest-server-noauth
23612361
- test-latest-replica_set-noauth

.evergreen/config.yml.in

+1-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ functions:
163163
fi
164164

165165
MONGODB_URI="${MONGODB_URI}" \
166-
AUTH=${AUTH} SSL=${SSL} UNIFIED=${UNIFIED} \
166+
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
167167
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
168168
NODE_VERSION=${NODE_VERSION} SKIP_DEPS=${SKIP_DEPS|1} NO_EXIT=${NO_EXIT|1} \
169169
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
@@ -228,7 +228,6 @@ functions:
228228
MONGODB_URI="${MONGODB_URI}" \
229229
AUTH=${AUTH} \
230230
SSL=${SSL} \
231-
UNIFIED=${UNIFIED} \
232231
MONGODB_API_VERSION="${MONGODB_API_VERSION}" \
233232
NODE_VERSION=${NODE_VERSION} \
234233
SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" \
@@ -629,7 +628,6 @@ functions:
629628
script: |
630629
${PREPARE_SHELL}
631630

632-
UNIFIED=${UNIFIED} \
633631
CA_FILE="$DRIVERS_TOOLS/.evergreen/ocsp/rsa/ca.pem" \
634632
OCSP_TLS_SHOULD_SUCCEED="${OCSP_TLS_SHOULD_SUCCEED}" \
635633
bash ${PROJECT_DIRECTORY}/.evergreen/run-ocsp-tests.sh

.evergreen/generate_evergreen_tasks.js

+19-12
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,18 @@ function generateVersionTopologyMatrix() {
7272
function* _generate() {
7373
for (const mongoVersion of MONGODB_VERSIONS) {
7474
for (const topology of TOPOLOGIES) {
75-
yield { mongoVersion, topology}
75+
yield { mongoVersion, topology };
7676
}
7777
}
7878
}
7979

8080
return Array.from(_generate());
8181
}
8282

83-
const BASE_TASKS = generateVersionTopologyMatrix().map(makeTask)
84-
const AUTH_DISABLED_TASKS = generateVersionTopologyMatrix().map((test) => makeTask({ ...test, auth: 'noauth', tags: ['noauth'] }))
83+
const BASE_TASKS = generateVersionTopologyMatrix().map(makeTask);
84+
const AUTH_DISABLED_TASKS = generateVersionTopologyMatrix().map(test =>
85+
makeTask({ ...test, auth: 'noauth', tags: ['noauth'] })
86+
);
8587

8688
BASE_TASKS.push({
8789
name: `test-latest-server-v1-api`,
@@ -323,7 +325,7 @@ TLS_VERSIONS.forEach(VERSION => {
323325
vars: {
324326
VERSION,
325327
SSL: 'ssl',
326-
TOPOLOGY: 'server',
328+
TOPOLOGY: 'server'
327329
// TODO: NODE-3891 - fix tests broken when AUTH enabled
328330
// AUTH: 'auth'
329331
}
@@ -702,10 +704,8 @@ const coverageTask = {
702704
func: 'download and merge coverage'
703705
}
704706
],
705-
depends_on: [
706-
{ name: '*', variant: '*', status: '*', patch_optional: true }
707-
]
708-
}
707+
depends_on: [{ name: '*', variant: '*', status: '*', patch_optional: true }]
708+
};
709709

710710
SINGLETON_TASKS.push(...oneOffFuncAsTasks);
711711

@@ -728,14 +728,21 @@ BUILD_VARIANTS.push({
728728
});
729729

730730
BUILD_VARIANTS.push({
731-
name: 'no-auth-tests',
731+
name: 'ubuntu1804-no-auth-tests',
732732
display_name: 'No Auth Tests',
733-
run_on: 'ubuntu1804-test',
733+
run_on: DEFAULT_OS,
734+
expansions: {
735+
CLIENT_ENCRYPTION: true
736+
},
734737
tasks: AUTH_DISABLED_TASKS.map(({ name }) => name)
735-
})
738+
});
736739

737740
const fileData = yaml.load(fs.readFileSync(`${__dirname}/config.yml.in`, 'utf8'));
738-
fileData.tasks = (fileData.tasks || []).concat(BASE_TASKS).concat(TASKS).concat(SINGLETON_TASKS).concat(AUTH_DISABLED_TASKS);
741+
fileData.tasks = (fileData.tasks || [])
742+
.concat(BASE_TASKS)
743+
.concat(TASKS)
744+
.concat(SINGLETON_TASKS)
745+
.concat(AUTH_DISABLED_TASKS);
739746
fileData.buildvariants = (fileData.buildvariants || []).concat(BUILD_VARIANTS);
740747

741748
fs.writeFileSync(`${__dirname}/config.yml`, yaml.dump(fileData, { lineWidth: 120 }), 'utf8');

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -o errexit # Exit the script with error if any of the commands fail
1919
# Get access to the AWS temporary credentials:
2020
echo "adding temporary AWS credentials to environment"
2121
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
22-
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh
22+
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
2323

2424
ABS_PATH_TO_PATCH=$(pwd)
2525

@@ -65,6 +65,7 @@ cp -R ../csfle-deps-tmp/libmongocrypt/bindings/node node_modules/mongodb-client-
6565
export MONGODB_URI=${MONGODB_URI}
6666
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
6767
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
68+
export TEST_CSFLE=true
6869
set +o errexit # We want to run both test suites even if the first fails
6970
npm run check:csfle
7071
DRIVER_CSFLE_TEST_RESULT=$?

.evergreen/run-ocsp-tests.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
set -o xtrace
33
set -o errexit
44

5-
UNIFIED=${UNIFIED:-}
6-
75
# load node.js environment
86
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"
97

@@ -14,7 +12,6 @@ source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"
1412
# PYTHON=python
1513

1614
# NOTE: `--opts {}` is used below to revert mocha to normal behavior (without mongodb specific plugins)
17-
MONGODB_UNIFIED_TOPOLOGY=${UNIFIED} \
18-
OCSP_TLS_SHOULD_SUCCEED=${OCSP_TLS_SHOULD_SUCCEED} \
19-
CA_FILE=${CA_FILE} \
15+
export OCSP_TLS_SHOULD_SUCCEED=${OCSP_TLS_SHOULD_SUCCEED}
16+
export CA_FILE=${CA_FILE}
2017
npm run check:ocsp

.evergreen/run-tests.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ set -o errexit # Exit the script with error if any of the commands fail
55
# Supported/used environment variables:
66
# AUTH Set to enable authentication. Defaults to "noauth"
77
# SSL Set to enable SSL. Defaults to "nossl"
8-
# UNIFIED Set to enable the Unified SDAM topology for the node driver
98
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
109
# MARCH Machine Architecture. Defaults to lowercase uname -m
1110
# TEST_NPM_SCRIPT Script to npm run. Defaults to "integration-coverage"
1211
# SKIP_DEPS Skip installing dependencies
1312
# NO_EXIT Don't exit early from tests that leak resources
13+
# TEST_CSFLE Set to enforce running csfle tests
1414

1515
AUTH=${AUTH:-noauth}
16-
UNIFIED=${UNIFIED:-}
1716
MONGODB_URI=${MONGODB_URI:-}
1817
TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-check:integration-coverage}
1918
if [[ -z "${NO_EXIT}" ]]; then
@@ -45,9 +44,17 @@ else
4544
# Get access to the AWS temporary credentials:
4645
echo "adding temporary AWS credentials to environment"
4746
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
48-
. $DRIVERS_TOOLS/.evergreen/csfle/set-temp-creds.sh
47+
source "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh
4948
fi
5049

5150
npm install mongodb-client-encryption@">=2.0.0-beta.4"
5251

53-
AUTH=$AUTH SINGLE_MONGOS_LB_URI=${SINGLE_MONGOS_LB_URI} MULTI_MONGOS_LB_URI=${MULTI_MONGOS_LB_URI} MONGODB_API_VERSION=${MONGODB_API_VERSION} MONGODB_UNIFIED_TOPOLOGY=${UNIFIED} MONGODB_URI=${MONGODB_URI} LOAD_BALANCER=${LOAD_BALANCER} npm run ${TEST_NPM_SCRIPT}
52+
export AUTH=$AUTH
53+
export SINGLE_MONGOS_LB_URI=${SINGLE_MONGOS_LB_URI}
54+
export MULTI_MONGOS_LB_URI=${MULTI_MONGOS_LB_URI}
55+
export MONGODB_API_VERSION=${MONGODB_API_VERSION}
56+
export MONGODB_URI=${MONGODB_URI}
57+
export LOAD_BALANCER=${LOAD_BALANCER}
58+
export TEST_CSFLE=${TEST_CSFLE}
59+
# Do not add quotes, due to the way NO_EXIT is handled
60+
npm run ${TEST_NPM_SCRIPT}

test/integration/client-side-encryption/client_side_encryption.corpus.spec.test.js renamed to test/integration/client-side-encryption/client_side_encryption.prose.corpus.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const BSON = require('bson');
88
const { EJSON } = require('bson');
99
const { expect } = require('chai');
1010

11-
describe('Client Side Encryption Corpus', function () {
11+
describe('Client Side Encryption Prose Corpus Test', function () {
1212
const metadata = {
1313
requires: {
1414
mongodb: '>=4.2.0',

0 commit comments

Comments
 (0)