Skip to content

Commit f44902e

Browse files
committed
refactor!(NODE-3295): Support node 12+ and reconfigure CI
1 parent 1a57ba8 commit f44902e

17 files changed

+510
-338
lines changed

.evergreen/config.yml

Lines changed: 349 additions & 170 deletions
Large diffs are not rendered by default.

.evergreen/config.yml.in

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -245,25 +245,35 @@ functions:
245245
. ./prepare_atlas_connectivity.sh
246246
rm -f ./prepare_atlas_connectivity.sh
247247

248-
NODE_LTS_NAME='${NODE_LTS_NAME}' bash ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
248+
export PROJECT_DIRECTORY="$(pwd)"
249+
export NODE_LTS_NAME='${NODE_LTS_NAME}'
250+
251+
bash ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh
249252

250253
"run kerberos tests":
251254
- command: shell.exec
252255
type: test
253256
params:
254257
working_dir: src
255258
script: |
256-
KRB5_KEYTAB='${gssapi_auth_keytab_base64}' KRB5_PRINCIPAL='${gssapi_auth_principal}' \
257-
MONGODB_URI='${gssapi_auth_mongodb_uri}' \
258-
NODE_LTS_NAME='${NODE_LTS_NAME}' bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh
259+
export PROJECT_DIRECTORY="$(pwd)"
260+
export KRB5_KEYTAB='${gssapi_auth_keytab_base64}'
261+
export KRB5_PRINCIPAL='${gssapi_auth_principal}'
262+
export MONGODB_URI='${gssapi_auth_mongodb_uri}'
263+
export NODE_LTS_NAME='${NODE_LTS_NAME}'
264+
265+
bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh
259266

260267
"run ldap tests":
261268
- command: shell.exec
262269
type: test
263270
params:
264271
working_dir: "src"
265272
script: |
266-
MONGODB_URI='${plain_auth_mongodb_uri}' NODE_LTS_NAME='${NODE_LTS_NAME}' \
273+
export PROJECT_DIRECTORY="$(pwd)"
274+
export MONGODB_URI='${plain_auth_mongodb_uri}'
275+
export NODE_LTS_NAME='${NODE_LTS_NAME}'
276+
267277
bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh
268278

269279
"run data lake tests":
@@ -272,7 +282,10 @@ functions:
272282
params:
273283
working_dir: src
274284
script: |
275-
MONGODB_URI='mongodb://mhuser:pencil@localhost' NODE_LTS_NAME='${NODE_LTS_NAME}' \
285+
export PROJECT_DIRECTORY="$(pwd)"
286+
export MONGODB_URI='mongodb://mhuser:pencil@localhost'
287+
export NODE_LTS_NAME='${NODE_LTS_NAME}'
288+
276289
bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh
277290

278291
"run tls tests":
@@ -281,9 +294,14 @@ functions:
281294
params:
282295
working_dir: "src"
283296
script: |
284-
NODE_LTS_NAME=${NODE_LTS_NAME} DRIVERS_TOOLS="${DRIVERS_TOOLS}" \
285-
SSL_CA_FILE="${SSL_CA_FILE}" SSL_KEY_FILE="${SSL_KEY_FILE}" \
286-
MONGODB_URI="${MONGODB_URI}" bash ${PROJECT_DIRECTORY}/.evergreen/run-tls-tests.sh
297+
export PROJECT_DIRECTORY="$(pwd)"
298+
export NODE_LTS_NAME=${NODE_LTS_NAME}
299+
export DRIVERS_TOOLS="${DRIVERS_TOOLS}"
300+
export SSL_CA_FILE="${SSL_CA_FILE}"
301+
export SSL_KEY_FILE="${SSL_KEY_FILE}"
302+
export MONGODB_URI="${MONGODB_URI}"
303+
304+
bash ${PROJECT_DIRECTORY}/.evergreen/run-tls-tests.sh
287305

288306
"add aws auth variables to file":
289307
- command: shell.exec
@@ -497,14 +515,18 @@ functions:
497515
params:
498516
script: |
499517
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
500-
/opt/mongodbtoolchain/v3/bin/python3 -m venv ./venv
501-
./venv/bin/pip3 install -r ${DRIVERS_TOOLS}/.evergreen/ocsp/mock-ocsp-responder-requirements.txt
518+
export PYTHON_BINARY=$([ "Windows_NT" = "$OS" ] && echo "/cygdrive/c/python/python38/python.exe" || echo "/opt/mongodbtoolchain/v3/bin/python3")
519+
export PYTHON_VENV_PATH=$([ "Windows_NT" = "$OS" ] && echo "./venv/Scripts" || echo "./venv/bin")
520+
521+
$PYTHON_BINARY -m venv ./venv
522+
$PYTHON_VENV_PATH/pip3 install -r ${DRIVERS_TOOLS}/.evergreen/ocsp/mock-ocsp-responder-requirements.txt
523+
502524
- command: shell.exec
503525
params:
504526
background: true
505527
script: |
506528
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
507-
nohup ./venv/bin/python3 ocsp_mock.py \
529+
nohup $PYTHON_VENV_PATH/python3 ocsp_mock.py \
508530
--ca_file rsa/ca.pem \
509531
--ocsp_responder_cert rsa/ca.crt \
510532
--ocsp_responder_key rsa/ca.key \
@@ -515,14 +537,19 @@ functions:
515537
params:
516538
script: |
517539
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
518-
/opt/mongodbtoolchain/v3/bin/python3 -m venv ./venv
519-
./venv/bin/pip3 install -r ${DRIVERS_TOOLS}/.evergreen/ocsp/mock-ocsp-responder-requirements.txt
540+
541+
export PYTHON_BINARY=$([ "Windows_NT" = "$OS" ] && echo "/cygdrive/c/python/python38/python.exe" || echo "/opt/mongodbtoolchain/v3/bin/python3")
542+
export PYTHON_VENV_PATH=$([ "Windows_NT" = "$OS" ] && echo "./venv/Scripts" || echo "./venv/bin")
543+
544+
$PYTHON_BINARY -m venv ./venv
545+
$PYTHON_VENV_PATH/pip3 install -r ${DRIVERS_TOOLS}/.evergreen/ocsp/mock-ocsp-responder-requirements.txt
546+
520547
- command: shell.exec
521548
params:
522549
background: true
523550
script: |
524551
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
525-
nohup ./venv/bin/python3 ocsp_mock.py \
552+
nohup $PYTHON_VENV_PATH/python3 ocsp_mock.py \
526553
--ca_file rsa/ca.pem \
527554
--ocsp_responder_cert rsa/ca.crt \
528555
--ocsp_responder_key rsa/ca.key \

.evergreen/generate_evergreen_tasks.js

Lines changed: 55 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,40 @@ const fs = require('fs');
33
const yaml = require('js-yaml');
44

55
const LATEST_EFFECTIVE_VERSION = '5.0';
6-
const MONGODB_VERSIONS = ['latest', '4.4', '4.2', '4.0', '3.6', '3.4', '3.2', '3.0', '2.6'];
7-
const NODE_VERSIONS = ['dubnium', 'erbium', 'fermium'];
6+
const MONGODB_VERSIONS = ['latest', '5.0', '4.4', '4.2', '4.0', '3.6', '3.4', '3.2', '3.0', '2.6'];
7+
const LOWEST_LTS = 'erbium';
8+
const NODE_VERSIONS = [LOWEST_LTS, 'fermium'];
89
const TOPOLOGIES = ['server', 'replica_set', 'sharded_cluster'];
9-
const AWS_AUTH_VERSIONS = ['latest', '4.4'];
10-
const OCSP_VERSIONS = ['latest', '4.4'];
11-
const TLS_VERSIONS = ['latest', '4.2']; // also test on 4.2 because 4.4+ currently skipped on windows
10+
const AWS_AUTH_VERSIONS = ['latest', '5.0', '4.4'];
11+
const OCSP_VERSIONS = ['latest', '5.0', '4.4'];
12+
const TLS_VERSIONS = ['latest', '5.0', '4.4', '4.2'];
13+
14+
const DEFAULT_OS = 'ubuntu1804-large'
1215

1316
const OPERATING_SYSTEMS = [
1417
{
1518
name: 'macos-1014',
1619
display_name: 'macOS 10.14',
17-
run_on: 'macos-1014',
18-
auth: false
19-
},
20-
{
21-
name: 'rhel70',
22-
display_name: 'RHEL 7.0',
23-
run_on: 'rhel70-small'
24-
},
25-
{
26-
name: 'ubuntu-14.04',
27-
display_name: 'Ubuntu 14.04',
28-
run_on: 'ubuntu1404-large',
29-
mongoVersion: '<4.2'
20+
run_on: 'macos-1014'
3021
},
3122
{
3223
name: 'ubuntu-18.04',
3324
display_name: 'Ubuntu 18.04',
34-
run_on: 'ubuntu1804-large',
35-
mongoVersion: '>=3.2',
36-
clientEncryption: true
37-
},
38-
{
39-
name: 'windows-64-vs2015',
40-
display_name: 'Windows (VS2015)',
41-
run_on: 'windows-64-vs2015-large',
42-
msvsVersion: 2015,
43-
mongoVersion: '<4.4'
25+
run_on: 'ubuntu1804-large'
4426
},
4527
{
46-
name: 'windows-64-vs2017',
47-
display_name: 'Windows (VS2017)',
48-
run_on: 'windows-64-vs2017-large',
49-
msvsVersion: 2017,
50-
mongoVersion: '<4.4'
28+
name: 'windows-64-vs2019',
29+
display_name: 'Windows (VS2019)',
30+
run_on: 'windows-64-vs2019-large',
31+
msvsVersion: 2019
5132
}
52-
].map(osConfig =>
53-
Object.assign(
54-
{
55-
mongoVersion: '>=2.6',
56-
nodeVersion: 'dubnium',
57-
auth: false
58-
},
59-
osConfig
60-
)
61-
);
33+
].map(osConfig => ({
34+
mongoVersion: '>=2.6',
35+
nodeVersion: LOWEST_LTS,
36+
auth: false, // TODO test auth?
37+
clientEncryption: false, // TODO(NODE-3372): Reenable with the next FLE release
38+
...osConfig
39+
}));
6240

6341
// TODO: NODE-3060: enable skipped tests on windows
6442
const WINDOWS_SKIP_TAGS = new Set(['atlas-connect', 'auth']);
@@ -112,7 +90,7 @@ BASE_TASKS.push({
11290
});
11391

11492
// manually added tasks
115-
Array.prototype.push.apply(TASKS, [
93+
TASKS.push(...[
11694
{
11795
name: 'test-atlas-connectivity',
11896
tags: ['atlas-connect'],
@@ -276,7 +254,7 @@ TLS_VERSIONS.forEach(VERSION => {
276254

277255
OCSP_VERSIONS.forEach(VERSION => {
278256
// manually added tasks
279-
Array.prototype.push.apply(TASKS, [
257+
TASKS.push(...[
280258
{
281259
name: `test-${VERSION}-ocsp-valid-cert-server-staples`,
282260
tags: ['ocsp'],
@@ -400,7 +378,7 @@ OCSP_VERSIONS.forEach(VERSION => {
400378
const AWS_AUTH_TASKS = [];
401379

402380
AWS_AUTH_VERSIONS.forEach(VERSION => {
403-
const name = (ex) => `aws-${VERSION}-auth-test-${ex.split(' ').join('-')}`;
381+
const name = ex => `aws-${VERSION}-auth-test-${ex.split(' ').join('-')}`;
404382
const aws_funcs = [
405383
{ func: 'run aws auth test with regular aws credentials' },
406384
{ func: 'run aws auth test with assume role credentials' },
@@ -427,13 +405,12 @@ AWS_AUTH_VERSIONS.forEach(VERSION => {
427405
{ func: 'setup aws env' },
428406
fn
429407
]
430-
}))
408+
}));
431409

432410
TASKS.push(...aws_tasks);
433-
AWS_AUTH_TASKS.push(...aws_tasks.map(t => t.name))
411+
AWS_AUTH_TASKS.push(...aws_tasks.map(t => t.name));
434412
});
435413

436-
437414
const BUILD_VARIANTS = [];
438415

439416
const getTaskList = (() => {
@@ -516,29 +493,33 @@ SINGLETON_TASKS.push({
516493
{
517494
func: 'install dependencies',
518495
vars: {
519-
NODE_LTS_NAME: 'erbium'
496+
NODE_LTS_NAME: LOWEST_LTS
520497
}
521498
},
522499
{ func: 'run checks' }
523500
]
524501
});
525502

526-
BUILD_VARIANTS.push({
527-
name: 'lint',
528-
display_name: 'lint',
529-
run_on: 'rhel70',
530-
tasks: ['run-checks']
531-
}, {
532-
name: 'ubuntu1804-custom-csfle-tests',
533-
display_name: 'Custom FLE Version Test',
534-
run_on: 'ubuntu1804-test',
535-
tasks: ['run-custom-csfle-tests']
536-
},{
537-
name: 'ubuntu1804-run-bson-ext-test',
538-
display_name: 'BSON EXT Test',
539-
run_on: 'ubuntu1804-test',
540-
tasks: ['run-bson-ext-test']
541-
});
503+
BUILD_VARIANTS.push(
504+
{
505+
name: 'lint',
506+
display_name: 'lint',
507+
run_on: DEFAULT_OS,
508+
tasks: ['run-checks']
509+
},
510+
{
511+
name: 'ubuntu1804-custom-csfle-tests',
512+
display_name: 'Custom FLE Version Test',
513+
run_on: DEFAULT_OS,
514+
tasks: ['run-custom-csfle-tests']
515+
},
516+
{
517+
name: 'ubuntu1804-run-bson-ext-test',
518+
display_name: 'BSON EXT Test',
519+
run_on: DEFAULT_OS,
520+
tasks: ['run-bson-ext-test']
521+
}
522+
);
542523

543524
// singleton build variant for mongosh integration tests
544525
SINGLETON_TASKS.push({
@@ -569,7 +550,7 @@ BUILD_VARIANTS.push({
569550
display_name: 'MONGODB-AWS Auth test',
570551
run_on: 'ubuntu1804-test',
571552
expansions: {
572-
NODE_LTS_NAME: 'dubnium'
553+
NODE_LTS_NAME: LOWEST_LTS
573554
},
574555
tasks: AWS_AUTH_TASKS
575556
});
@@ -582,8 +563,8 @@ SINGLETON_TASKS.push({
582563
{
583564
func: 'install dependencies',
584565
vars: {
585-
NODE_LTS_NAME: 'erbium',
586-
},
566+
NODE_LTS_NAME: LOWEST_LTS
567+
}
587568
},
588569
{
589570
func: 'bootstrap mongo-orchestration',
@@ -604,8 +585,8 @@ SINGLETON_TASKS.push({
604585
{
605586
func: 'install dependencies',
606587
vars: {
607-
NODE_LTS_NAME: 'fermium',
608-
},
588+
NODE_LTS_NAME: LOWEST_LTS
589+
}
609590
},
610591
{
611592
func: 'bootstrap mongo-orchestration',
@@ -614,9 +595,10 @@ SINGLETON_TASKS.push({
614595
TOPOLOGY: 'server'
615596
}
616597
},
617-
{ func: 'run bson-ext test',
598+
{
599+
func: 'run bson-ext test',
618600
vars: {
619-
NODE_LTS_NAME: 'fermium',
601+
NODE_LTS_NAME: LOWEST_LTS
620602
}
621603
}
622604
]

.evergreen/init-nvm.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! /usr/bin/env bash
2+
3+
export PATH="/opt/mongodbtoolchain/v2/bin:$PATH"
4+
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
5+
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
6+
7+
if [[ "$OS" == "Windows_NT" ]]; then
8+
NVM_HOME=$(cygpath -w "$NVM_DIR")
9+
export NVM_HOME
10+
NVM_SYMLINK=$(cygpath -w "$NODE_ARTIFACTS_PATH/bin")
11+
export NVM_SYMLINK
12+
NVM_ARTIFACTS_PATH=$(cygpath -w "$NODE_ARTIFACTS_PATH/bin")
13+
export NVM_ARTIFACTS_PATH
14+
PATH=$(cygpath $NVM_SYMLINK):$(cygpath $NVM_HOME):$PATH
15+
export PATH
16+
echo "updated path on windows PATH=$PATH"
17+
else
18+
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
19+
fi

0 commit comments

Comments
 (0)