Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,8 @@ tasks:
updates:
- {key: NODE_LTS_VERSION, value: '22'}
- func: install dependencies
vars:
NPM_VERSION: 11.11.1
- func: run unit tests
- name: run-unit-tests-node-24
tags:
Expand Down Expand Up @@ -3575,6 +3577,7 @@ buildvariants:
run_on: rhel80-large
expansions:
NODE_LTS_VERSION: 22
NPM_VERSION: 11.11.1
CLIENT_ENCRYPTION: 'true'
TEST_CSFLE: 'true'
tasks:
Expand Down Expand Up @@ -3782,6 +3785,7 @@ buildvariants:
run_on: windows-2022-latest-large
expansions:
NODE_LTS_VERSION: 22
NPM_VERSION: 11.11.1
CLIENT_ENCRYPTION: 'false'
TEST_CSFLE: 'false'
tasks:
Expand Down
18 changes: 17 additions & 1 deletion .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ const {
UBUNTU_22_OS
} = require('./ci_matrix_constants');

// TODO(NODE-7499): unpin npm version once Node 22 ships a bundled npm that can upgrade itself
const NODE22_NPM_VERSION = '11.11.1';

/** Returns the major version number from a Node.js version string (e.g. 'v22.11.0', '20.19.0', 22). */
function nodeMajorVersion(version) {
return semver.coerce(String(version))?.major;
}

const OPERATING_SYSTEMS = [
{
name: DEFAULT_OS,
Expand Down Expand Up @@ -397,6 +405,12 @@ for (const {
const expansions = { NODE_LTS_VERSION };
const taskNames = tasks.map(({ name }) => name);

// bundled npm version in node v22.22.2 (v10.9.7) can't upgrade itself to @latest,
// so we need to pin npm version for these variants to latest "upgradable" version
if (nodeMajorVersion(NODE_LTS_VERSION) === 22) {
expansions.NPM_VERSION = NODE22_NPM_VERSION;
}

expansions.CLIENT_ENCRYPTION = String(!!clientEncryption);
expansions.TEST_CSFLE = expansions.CLIENT_ENCRYPTION;

Expand Down Expand Up @@ -478,7 +492,9 @@ const unitTestTasks = Array.from(
updateExpansions({
NODE_LTS_VERSION
}),
{ func: 'install dependencies' },
nodeMajorVersion(NODE_LTS_VERSION) === 22
? { func: 'install dependencies', vars: { NPM_VERSION: NODE22_NPM_VERSION } }
: { func: 'install dependencies' },
{ func: 'run unit tests' }
]
};
Expand Down
Loading