diff --git a/.evergreen/ci_matrix_constants.js b/.evergreen/ci_matrix_constants.js index cb8c2c59294..736302ded82 100644 --- a/.evergreen/ci_matrix_constants.js +++ b/.evergreen/ci_matrix_constants.js @@ -3,10 +3,11 @@ const versions = [ { codeName: 'erbium', versionNumber: 12 }, { codeName: 'fermium', versionNumber: 14 }, { codeName: 'gallium', versionNumber: 16 }, - { codeName: 'hydrogen', versionNumber: 18 } + { codeName: 'hydrogen', versionNumber: 18 }, + { codeName: 'iron', versionNumber: 20 } ]; -const NODE_VERSIONS = versions.map(({ codeName }) => codeName); -NODE_VERSIONS.sort(); +const NODE_VERSIONS = versions.map(({ versionNumber }) => versionNumber); +NODE_VERSIONS.sort((a, b) => a - b); const LOWEST_LTS = NODE_VERSIONS[0]; const LATEST_LTS = NODE_VERSIONS[NODE_VERSIONS.length - 1]; diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 8f7f190f9fb..ab556056a1e 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -400,7 +400,7 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - NODE_LTS_NAME=${NODE_LTS_NAME} NPM_OPTIONS=${NPM_OPTIONS}\ + NODE_LTS_VERSION=${NODE_LTS_VERSION} NPM_OPTIONS=${NPM_OPTIONS}\ bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh "run atlas tests": @@ -424,7 +424,7 @@ functions: rm -f ./prepare_atlas_connectivity.sh export PROJECT_DIRECTORY="$(pwd)" - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh @@ -454,7 +454,7 @@ functions: export PYTHON_BINARY=$([ "Windows_NT" = "$OS" ] && echo "/cygdrive/c/python/python38/python.exe" || echo "/opt/mongodbtoolchain/v3/bin/python3") export PROJECT_DIRECTORY="$(pwd)" export DRIVERS_TOOLS="${DRIVERS_TOOLS}" - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' export MONGODB_URI="${MONGODB_URI}" export SSL="${SSL}" @@ -475,7 +475,7 @@ functions: export KRB5_KEYTAB='${gssapi_auth_keytab_base64}' export KRB5_PRINCIPAL='${gssapi_auth_principal}' export MONGODB_URI='${gssapi_auth_mongodb_uri}' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh @@ -487,7 +487,7 @@ functions: script: | export PROJECT_DIRECTORY="$(pwd)" export MONGODB_URI='${plain_auth_mongodb_uri}' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh @@ -499,7 +499,7 @@ functions: script: | export PROJECT_DIRECTORY="$(pwd)" export MONGODB_URI='mongodb://mhuser:pencil@localhost' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh @@ -510,7 +510,7 @@ functions: working_dir: "src" script: | export PROJECT_DIRECTORY="$(pwd)" - export NODE_LTS_NAME=${NODE_LTS_NAME} + export NODE_LTS_VERSION=${NODE_LTS_VERSION} export DRIVERS_TOOLS="${DRIVERS_TOOLS}" export SSL_CA_FILE="${SSL_CA_FILE}" export SSL_KEY_FILE="${SSL_KEY_FILE}" @@ -1034,7 +1034,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 18 - func: bootstrap mongo-orchestration vars: VERSION: rapid diff --git a/.evergreen/config.yml b/.evergreen/config.yml index f49e875a5c6..dae0efade8e 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -354,7 +354,7 @@ functions: working_dir: src script: | ${PREPARE_SHELL} - NODE_LTS_NAME=${NODE_LTS_NAME} NPM_OPTIONS=${NPM_OPTIONS}\ + NODE_LTS_VERSION=${NODE_LTS_VERSION} NPM_OPTIONS=${NPM_OPTIONS}\ bash ${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh run atlas tests: - command: shell.exec @@ -377,7 +377,7 @@ functions: rm -f ./prepare_atlas_connectivity.sh export PROJECT_DIRECTORY="$(pwd)" - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-atlas-tests.sh run socks5 tests: @@ -411,7 +411,7 @@ functions: export DRIVERS_TOOLS="${DRIVERS_TOOLS}" - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' export MONGODB_URI="${MONGODB_URI}" @@ -438,7 +438,7 @@ functions: export KRB5_KEYTAB='${gssapi_auth_keytab_base64}' export KRB5_PRINCIPAL='${gssapi_auth_principal}' export MONGODB_URI='${gssapi_auth_mongodb_uri}' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-kerberos-tests.sh run ldap tests: @@ -449,7 +449,7 @@ functions: script: | export PROJECT_DIRECTORY="$(pwd)" export MONGODB_URI='${plain_auth_mongodb_uri}' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-ldap-tests.sh run data lake tests: @@ -460,7 +460,7 @@ functions: script: | export PROJECT_DIRECTORY="$(pwd)" export MONGODB_URI='mongodb://mhuser:pencil@localhost' - export NODE_LTS_NAME='${NODE_LTS_NAME}' + export NODE_LTS_VERSION='${NODE_LTS_VERSION}' bash ${PROJECT_DIRECTORY}/.evergreen/run-data-lake-tests.sh run tls tests: @@ -470,7 +470,7 @@ functions: working_dir: src script: | export PROJECT_DIRECTORY="$(pwd)" - export NODE_LTS_NAME=${NODE_LTS_NAME} + export NODE_LTS_VERSION=${NODE_LTS_VERSION} export DRIVERS_TOOLS="${DRIVERS_TOOLS}" export SSL_CA_FILE="${SSL_CA_FILE}" export SSL_KEY_FILE="${SSL_KEY_FILE}" @@ -974,7 +974,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 18 - func: bootstrap mongo-orchestration vars: VERSION: rapid @@ -2327,7 +2327,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: run unit tests - name: run-lint-checks tags: @@ -2335,7 +2335,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: run lint checks - name: check-types-typescript-next tags: @@ -2343,7 +2343,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 20 - func: check types vars: TS_VERSION: next @@ -2353,7 +2353,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: compile driver vars: TS_VERSION: current @@ -2363,7 +2363,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 20 - func: check types vars: TS_VERSION: current @@ -2373,7 +2373,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 20 - func: check types vars: TS_VERSION: 4.1.6 @@ -2392,7 +2392,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: '5.0' @@ -2406,7 +2406,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: '5.0' @@ -2415,7 +2415,7 @@ tasks: - name: run-bson-ext-integration func: run bson-ext test vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 TEST_NPM_SCRIPT: check:test - name: run-bson-ext-unit tags: @@ -2423,7 +2423,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: '5.0' @@ -2432,7 +2432,7 @@ tasks: - name: run-bson-ext-unit func: run bson-ext test vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 TEST_NPM_SCRIPT: check:unit - name: run-custom-csfle-tests-5.0-pinned-commit tags: @@ -2440,7 +2440,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: '5.0' @@ -2455,7 +2455,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: '5.0' @@ -2470,7 +2470,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: rapid @@ -2485,7 +2485,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: rapid @@ -2500,7 +2500,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: latest @@ -2515,7 +2515,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 - func: bootstrap mongo-orchestration vars: VERSION: latest @@ -2893,7 +2893,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: browser-repl @@ -2904,7 +2904,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: browser-runtime-electron @@ -2915,7 +2915,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: cli-repl @@ -2926,7 +2926,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: connectivity-tests @@ -2937,7 +2937,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: mongosh @@ -2948,7 +2948,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: node-runtime-worker-thread @@ -2959,7 +2959,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh tests for package vars: mongosh_package: service-provider-server @@ -2969,7 +2969,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: compile mongosh - name: verify-mongosh-scopes tags: @@ -2977,7 +2977,7 @@ tasks: commands: - func: install dependencies vars: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 - func: run mongosh package scope test task_groups: - name: serverless_task_group @@ -3034,7 +3034,7 @@ buildvariants: display_name: rhel8 Node12 run_on: rhel80-large expansions: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 CLIENT_ENCRYPTION: true tasks: - test-latest-server @@ -3082,7 +3082,7 @@ buildvariants: display_name: rhel8 Node14 run_on: rhel80-large expansions: - NODE_LTS_NAME: fermium + NODE_LTS_VERSION: 14 CLIENT_ENCRYPTION: true tasks: - test-latest-server @@ -3130,7 +3130,7 @@ buildvariants: display_name: rhel8 Node16 run_on: rhel80-large expansions: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 CLIENT_ENCRYPTION: true tasks: - test-latest-server @@ -3176,7 +3176,7 @@ buildvariants: display_name: rhel8 Node18 run_on: rhel80-large expansions: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 18 CLIENT_ENCRYPTION: true tasks: - test-latest-server @@ -3217,11 +3217,58 @@ buildvariants: - test-tls-support-5.0 - test-tls-support-4.4 - test-tls-support-4.2 + - name: rhel80-large-Node20 + display_name: rhel8 Node20 + run_on: rhel80-large + expansions: + NODE_LTS_VERSION: 20 + CLIENT_ENCRYPTION: true + tasks: + - test-latest-server + - test-latest-replica_set + - test-latest-sharded_cluster + - test-rapid-server + - test-rapid-replica_set + - test-rapid-sharded_cluster + - test-6.0-server + - test-6.0-replica_set + - test-6.0-sharded_cluster + - test-5.0-server + - test-5.0-replica_set + - test-5.0-sharded_cluster + - test-4.4-server + - test-4.4-replica_set + - test-4.4-sharded_cluster + - test-4.2-server + - test-4.2-replica_set + - test-4.2-sharded_cluster + - test-4.0-server + - test-4.0-replica_set + - test-4.0-sharded_cluster + - test-3.6-server + - test-3.6-replica_set + - test-3.6-sharded_cluster + - test-latest-server-v1-api + - test-atlas-connectivity + - test-atlas-data-lake + - test-5.0-load-balanced + - test-6.0-load-balanced + - test-latest-load-balanced + - test-auth-ldap + - test-socks5 + - test-socks5-tls + - test-zstd-compression + - test-snappy-compression + - test-tls-support-latest + - test-tls-support-6.0 + - test-tls-support-5.0 + - test-tls-support-4.4 + - test-tls-support-4.2 - name: rhel80-large-node-latest display_name: rhel8 Node Latest run_on: rhel80-large expansions: - NODE_LTS_NAME: latest + NODE_LTS_VERSION: latest CLIENT_ENCRYPTION: true tasks: - test-latest-server @@ -3265,7 +3312,7 @@ buildvariants: display_name: Windows (VS2019) Node14 run_on: windows-64-vs2019-large expansions: - NODE_LTS_NAME: fermium + NODE_LTS_VERSION: 14 tasks: - test-latest-server - test-latest-replica_set @@ -3306,7 +3353,7 @@ buildvariants: display_name: Windows (VS2019) Node16 run_on: windows-64-vs2019-large expansions: - NODE_LTS_NAME: gallium + NODE_LTS_VERSION: 16 tasks: - test-latest-server - test-latest-replica_set @@ -3345,7 +3392,7 @@ buildvariants: display_name: Windows (VS2019) Node18 run_on: windows-64-vs2019-large expansions: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 18 tasks: - test-latest-server - test-latest-replica_set @@ -3380,11 +3427,52 @@ buildvariants: - test-tls-support-5.0 - test-tls-support-4.4 - test-tls-support-4.2 + - name: windows-64-vs2019-Node20 + display_name: Windows (VS2019) Node20 + run_on: windows-64-vs2019-large + expansions: + NODE_LTS_VERSION: 20 + tasks: + - test-latest-server + - test-latest-replica_set + - test-latest-sharded_cluster + - test-rapid-server + - test-rapid-replica_set + - test-rapid-sharded_cluster + - test-6.0-server + - test-6.0-replica_set + - test-6.0-sharded_cluster + - test-5.0-server + - test-5.0-replica_set + - test-5.0-sharded_cluster + - test-4.4-server + - test-4.4-replica_set + - test-4.4-sharded_cluster + - test-4.2-server + - test-4.2-replica_set + - test-4.2-sharded_cluster + - test-4.0-server + - test-4.0-replica_set + - test-4.0-sharded_cluster + - test-3.6-server + - test-3.6-replica_set + - test-3.6-sharded_cluster + - test-latest-server-v1-api + - test-atlas-data-lake + - test-socks5 + - test-socks5-tls + - test-zstd-compression + - test-snappy-compression + - test-tls-support-latest + - test-tls-support-6.0 + - test-tls-support-5.0 + - test-tls-support-4.4 + - test-tls-support-4.2 - name: macos-1100 - display_name: MacOS 11 Node18 + display_name: MacOS 11 Node20 run_on: macos-1100 expansions: - NODE_LTS_NAME: hydrogen + NODE_LTS_VERSION: 20 CLIENT_ENCRYPTION: true tasks: - test-rapid-server @@ -3420,7 +3508,7 @@ buildvariants: display_name: MONGODB-AWS Auth test run_on: ubuntu1804-large expansions: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 tasks: - aws-latest-auth-test-run-aws-auth-test-with-regular-aws-credentials - aws-latest-auth-test-run-aws-auth-test-with-assume-role-credentials @@ -3504,7 +3592,7 @@ buildvariants: display_name: Serverless Test run_on: rhel80-large expansions: - NODE_LTS_NAME: erbium + NODE_LTS_VERSION: 12 tasks: - serverless_task_group - name: rhel8-no-auth-tests diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 12c95daa8df..f72b38bed36 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -35,7 +35,7 @@ const OPERATING_SYSTEMS = [ // TODO: NODE-3060: enable skipped tests on windows const WINDOWS_SKIP_TAGS = new Set(['atlas-connect', 'auth', 'load_balancer']); -const SKIPPED_WINDOWS_NODE_VERSIONS = new Set(['erbium']); +const SKIPPED_WINDOWS_NODE_VERSIONS = new Set([12]); const TASKS = []; const SINGLETON_TASKS = []; @@ -384,22 +384,19 @@ for (const { return !isAWSTask && !isSkippedTaskOnWindows; }); - for (const NODE_LTS_NAME of testedNodeVersions) { - const nodeVersionNumber = versions.find( - ({ codeName }) => codeName === NODE_LTS_NAME - ).versionNumber; - const nodeLtsDisplayName = - nodeVersionNumber === undefined ? `Node Latest` : `Node${nodeVersionNumber}`; - const name = `${osName}-${NODE_LTS_NAME}`; + for (const NODE_LTS_VERSION of testedNodeVersions) { + const nodeLTSCodeName = versions.find(({ versionNumber }) => versionNumber === NODE_LTS_VERSION).codeName; + const nodeLtsDisplayName = `Node${NODE_LTS_VERSION}`; + const name = `${osName}-${NODE_LTS_VERSION >= 20 ? nodeLtsDisplayName : nodeLTSCodeName}`; const display_name = `${osDisplayName} ${nodeLtsDisplayName}`; - const expansions = { NODE_LTS_NAME }; + const expansions = { NODE_LTS_VERSION }; const taskNames = tasks.map(({ name }) => name); if (clientEncryption) { expansions.CLIENT_ENCRYPTION = true; } - if (os.match(/^windows/) && SKIPPED_WINDOWS_NODE_VERSIONS.has(NODE_LTS_NAME)) { + if (os.match(/^windows/) && SKIPPED_WINDOWS_NODE_VERSIONS.has(NODE_LTS_VERSION)) { continue; } @@ -412,7 +409,7 @@ for (const { name: `${osName}-node-latest`, display_name: `${osDisplayName} Node Latest`, run_on, - expansions: { NODE_LTS_NAME: 'latest' }, + expansions: { NODE_LTS_VERSION: 'latest' }, tasks: tasks.map(({ name }) => name) }; if (clientEncryption) { @@ -426,11 +423,11 @@ for (const { BUILD_VARIANTS.push({ name: 'macos-1100', display_name: `MacOS 11 Node${ - versions.find(version => version.codeName === LATEST_LTS).versionNumber + versions.find(version => version.versionNumber === LATEST_LTS).versionNumber }`, run_on: 'macos-1100', expansions: { - NODE_LTS_NAME: LATEST_LTS, + NODE_LTS_VERSION: LATEST_LTS, CLIENT_ENCRYPTION: true }, tasks: ['test-rapid-server'] @@ -446,7 +443,7 @@ SINGLETON_TASKS.push( { func: 'install dependencies', vars: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS } }, { func: 'run unit tests' } @@ -459,7 +456,7 @@ SINGLETON_TASKS.push( { func: 'install dependencies', vars: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS } }, { func: 'run lint checks' } @@ -480,7 +477,7 @@ function* makeTypescriptTasks() { { func: 'install dependencies', vars: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS } }, { @@ -500,7 +497,7 @@ function* makeTypescriptTasks() { { func: 'install dependencies', vars: { - NODE_LTS_NAME: LATEST_LTS + NODE_LTS_VERSION: LATEST_LTS } }, { @@ -519,7 +516,7 @@ function* makeTypescriptTasks() { { func: 'install dependencies', vars: { - NODE_LTS_NAME: LATEST_LTS + NODE_LTS_VERSION: LATEST_LTS } }, { func: 'run typescript next' } @@ -558,7 +555,7 @@ BUILD_VARIANTS.push({ display_name: 'MONGODB-AWS Auth test', run_on: 'ubuntu1804-large', expansions: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS }, tasks: AWS_AUTH_TASKS }); @@ -572,7 +569,7 @@ const oneOffFuncs = [ name: 'run-bson-ext-integration', func: 'run bson-ext test', vars: { - NODE_LTS_NAME: LOWEST_LTS, + NODE_LTS_VERSION: LOWEST_LTS, TEST_NPM_SCRIPT: 'check:test' } }, @@ -580,7 +577,7 @@ const oneOffFuncs = [ name: 'run-bson-ext-unit', func: 'run bson-ext test', vars: { - NODE_LTS_NAME: LOWEST_LTS, + NODE_LTS_VERSION: LOWEST_LTS, TEST_NPM_SCRIPT: 'check:unit' } } @@ -593,7 +590,7 @@ const oneOffFuncAsTasks = oneOffFuncs.map(oneOffFunc => ({ { func: 'install dependencies', vars: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS } }, { @@ -619,7 +616,7 @@ for (const version of ['5.0', 'rapid', 'latest']) { { func: 'install dependencies', vars: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS } }, { @@ -668,7 +665,7 @@ BUILD_VARIANTS.push({ display_name: 'Serverless Test', run_on: DEFAULT_OS, expansions: { - NODE_LTS_NAME: LOWEST_LTS + NODE_LTS_VERSION: LOWEST_LTS }, tasks: ['serverless_task_group'] }); @@ -694,7 +691,7 @@ BUILD_VARIANTS.push({ for (const variant of BUILD_VARIANTS.filter( variant => variant.expansions && - ['gallium', 'hydrogen', 'latest'].includes(variant.expansions.NODE_LTS_NAME) + [16, 18, 'latest'].includes(variant.expansions.NODE_LTS_VERSION) )) { variant.tasks = variant.tasks.filter( name => !['test-zstd-compression', 'test-snappy-compression'].includes(name) @@ -703,14 +700,14 @@ for (const variant of BUILD_VARIANTS.filter( // TODO(NODE-4894): fix kerberos tests on Node18 for (const variant of BUILD_VARIANTS.filter( - variant => variant.expansions && ['hydrogen', 'latest'].includes(variant.expansions.NODE_LTS_NAME) + variant => variant.expansions && [18, 20, 'latest'].includes(variant.expansions.NODE_LTS_VERSION) )) { variant.tasks = variant.tasks.filter(name => !['test-auth-kerberos'].includes(name)); } // TODO(NODE-4897): Debug socks5 tests on node latest for (const variant of BUILD_VARIANTS.filter( - variant => variant.expansions && ['latest'].includes(variant.expansions.NODE_LTS_NAME) + variant => variant.expansions && ['latest'].includes(variant.expansions.NODE_LTS_VERSION) )) { variant.tasks = variant.tasks.filter(name => !['test-socks5'].includes(name)); } diff --git a/.evergreen/generate_mongosh_tasks.js b/.evergreen/generate_mongosh_tasks.js index 6d129058269..6d689ba7064 100644 --- a/.evergreen/generate_mongosh_tasks.js +++ b/.evergreen/generate_mongosh_tasks.js @@ -17,7 +17,7 @@ const mongoshTestTasks = scopes.map(packageName => { { func: 'install dependencies', vars: { - NODE_LTS_NAME: 'gallium' + NODE_LTS_VERSION: 16 } }, { @@ -37,7 +37,7 @@ const compileTask = { { func: 'install dependencies', vars: { - NODE_LTS_NAME: 'gallium' + NODE_LTS_VERSION: 16 } }, { func: 'compile mongosh' } @@ -51,7 +51,7 @@ const scopeVerificationTask = { { func: 'install dependencies', vars: { - NODE_LTS_NAME: 'gallium' + NODE_LTS_VERSION: 16 } }, { func: 'run mongosh package scope test' } diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 8d836acaccb..8faa962da0e 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o errexit # Exit the script with error if any of the commands fail -NODE_LTS_NAME=${NODE_LTS_NAME:-erbium} +NODE_LTS_VERSION=${NODE_LTS_VERSION:-12} NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY:-$(pwd)}/node-artifacts" if [[ "$OS" = "Windows_NT" ]]; then NODE_ARTIFACTS_PATH=$(cygpath --unix "$NODE_ARTIFACTS_PATH"); fi @@ -28,11 +28,12 @@ curl "${CURL_FLAGS[@]}" "https://nodejs.org/dist/index.tab" --output node_index. while IFS=$'\t' read -r -a row; do node_index_version="${row[0]}" + node_index_major_version=$(echo $node_index_version | sed -E 's/^v([0-9]+).*$/\1/') node_index_date="${row[1]}" node_index_lts="${row[9]}" [[ "$node_index_version" = "version" ]] && continue # skip tsv header - [[ "$NODE_LTS_NAME" = "latest" ]] && break # first line is latest - [[ "$NODE_LTS_NAME" = "$node_index_lts" ]] && break # case insensitive compare + [[ "$NODE_LTS_VERSION" = "latest" ]] && break # first line is latest + [[ "$NODE_LTS_VERSION" = "$node_index_major_version" ]] && break # case insensitive compare done < node_index.tab if [[ "$OS" = "Windows_NT" ]]; then @@ -98,11 +99,11 @@ prefix=$NODE_ARTIFACTS_PATH/npm_global EOT # Cannot upgrade npm version for node 12 -if [[ $operating_system != "win" ]] && [[ $NODE_LTS_NAME != "erbium" ]]; then +if [[ $operating_system != "win" ]] && [[ $NODE_LTS_VERSION != 12 ]]; then # Update npm to latest when we can npm install --global npm@latest hash -r -elif [[ $NODE_LTS_NAME == "erbium" ]]; then +elif [[ $NODE_LTS_VERSION == 12 ]]; then # Node.js 12 can run up to npm v8 npm install --global npm@8 hash -r