Skip to content

Commit ee325d0

Browse files
authored
Merge branch 'main' into NODE-7430
2 parents 65c8500 + 1cf791f commit ee325d0

64 files changed

Lines changed: 3567 additions & 322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4+
"ignorePatterns": [
5+
"test/tools/runner/bundle/**"
6+
],
47
"parserOptions": {
58
"ecmaVersion": 2023
69
},

.evergreen/config.in.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,8 @@ tasks:
997997
- { key: VERSION, value: latest }
998998
- { key: NODE_LTS_VERSION, value: "20.19.0" }
999999
- func: install dependencies
1000+
vars:
1001+
NPM_VERSION: "11.11.1"
10001002
- func: switch source
10011003
vars:
10021004
SOURCE_REV: refs/tags/v7.0.0
@@ -1019,6 +1021,8 @@ tasks:
10191021
- { key: CLIENT_ENCRYPTION, value: "false" }
10201022
- { key: NODE_LTS_VERSION, value: "20.19.0" }
10211023
- func: install dependencies
1024+
vars:
1025+
NPM_VERSION: "11.11.1"
10221026
- func: bootstrap mongo-orchestration
10231027
- func: switch source
10241028
vars:
@@ -1042,6 +1046,8 @@ tasks:
10421046
- { key: CLIENT_ENCRYPTION, value: "false" }
10431047
- { key: NODE_LTS_VERSION, value: "20.19.0" }
10441048
- func: install dependencies
1049+
vars:
1050+
NPM_VERSION: "11.11.1"
10451051
- func: bootstrap mongo-orchestration
10461052
- func: switch source
10471053
vars:
@@ -1065,6 +1071,8 @@ tasks:
10651071
- { key: CLIENT_ENCRYPTION, value: "false" }
10661072
- { key: NODE_LTS_VERSION, value: "20.19.0" }
10671073
- func: install dependencies
1074+
vars:
1075+
NPM_VERSION: "11.11.1"
10681076
- func: bootstrap mongo-orchestration
10691077
- func: switch source
10701078
vars:

.evergreen/config.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,8 @@ tasks:
921921
- {key: VERSION, value: latest}
922922
- {key: NODE_LTS_VERSION, value: 20.19.0}
923923
- func: install dependencies
924+
vars:
925+
NPM_VERSION: 11.11.1
924926
- func: switch source
925927
vars:
926928
SOURCE_REV: refs/tags/v7.0.0
@@ -942,6 +944,8 @@ tasks:
942944
- {key: CLIENT_ENCRYPTION, value: 'false'}
943945
- {key: NODE_LTS_VERSION, value: 20.19.0}
944946
- func: install dependencies
947+
vars:
948+
NPM_VERSION: 11.11.1
945949
- func: bootstrap mongo-orchestration
946950
- func: switch source
947951
vars:
@@ -964,6 +968,8 @@ tasks:
964968
- {key: CLIENT_ENCRYPTION, value: 'false'}
965969
- {key: NODE_LTS_VERSION, value: 20.19.0}
966970
- func: install dependencies
971+
vars:
972+
NPM_VERSION: 11.11.1
967973
- func: bootstrap mongo-orchestration
968974
- func: switch source
969975
vars:
@@ -986,6 +992,8 @@ tasks:
986992
- {key: CLIENT_ENCRYPTION, value: 'false'}
987993
- {key: NODE_LTS_VERSION, value: 20.19.0}
988994
- func: install dependencies
995+
vars:
996+
NPM_VERSION: 11.11.1
989997
- func: bootstrap mongo-orchestration
990998
- func: switch source
991999
vars:
@@ -1986,6 +1994,8 @@ tasks:
19861994
updates:
19871995
- {key: NODE_LTS_VERSION, value: '22'}
19881996
- func: install dependencies
1997+
vars:
1998+
NPM_VERSION: 11.11.1
19891999
- func: run unit tests
19902000
- name: run-unit-tests-node-24
19912001
tags:
@@ -3567,6 +3577,7 @@ buildvariants:
35673577
run_on: rhel80-large
35683578
expansions:
35693579
NODE_LTS_VERSION: 22
3580+
NPM_VERSION: 11.11.1
35703581
CLIENT_ENCRYPTION: 'true'
35713582
TEST_CSFLE: 'true'
35723583
tasks:
@@ -3774,6 +3785,7 @@ buildvariants:
37743785
run_on: windows-2022-latest-large
37753786
expansions:
37763787
NODE_LTS_VERSION: 22
3788+
NPM_VERSION: 11.11.1
37773789
CLIENT_ENCRYPTION: 'false'
37783790
TEST_CSFLE: 'false'
37793791
tasks:
@@ -4019,3 +4031,52 @@ buildvariants:
40194031
run_on: rhel80-large
40204032
tasks:
40214033
- .ssl
4034+
- name: rhel8-nodeless
4035+
display_name: Nodeless
4036+
run_on: rhel80-large
4037+
tasks:
4038+
- test-latest-server
4039+
- test-latest-replica_set
4040+
- test-latest-sharded_cluster
4041+
- test-rapid-server
4042+
- test-rapid-replica_set
4043+
- test-rapid-sharded_cluster
4044+
- test-latest-server-v1-api
4045+
- test-x509-authentication
4046+
- test-atlas-connectivity
4047+
- test-auth-ldap
4048+
- test-socks5-csfle
4049+
- test-socks5-tls
4050+
- test-snappy-compression
4051+
- test-zstd-compression
4052+
- test-tls-support-latest
4053+
- test-rapid-load-balanced
4054+
- test-latest-load-balanced
4055+
- test-auth-kerberos
4056+
expansions:
4057+
NODE_LTS_VERSION: 24
4058+
CLIENT_ENCRYPTION: true
4059+
MONGODB_BUNDLED: true
4060+
- name: windows-nodeless
4061+
display_name: Windows Nodeless
4062+
run_on: windows-2022-latest-large
4063+
tasks:
4064+
- test-latest-server
4065+
- test-latest-replica_set
4066+
- test-latest-sharded_cluster
4067+
- test-rapid-server
4068+
- test-rapid-replica_set
4069+
- test-rapid-sharded_cluster
4070+
- test-latest-server-v1-api
4071+
- test-x509-authentication
4072+
- test-atlas-connectivity
4073+
- test-auth-ldap
4074+
- test-socks5-csfle
4075+
- test-socks5-tls
4076+
- test-snappy-compression
4077+
- test-zstd-compression
4078+
- test-tls-support-latest
4079+
expansions:
4080+
NODE_LTS_VERSION: 24
4081+
CLIENT_ENCRYPTION: true
4082+
MONGODB_BUNDLED: true

.evergreen/generate_evergreen_tasks.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ const {
2020
UBUNTU_22_OS
2121
} = require('./ci_matrix_constants');
2222

23+
// TODO(NODE-7499): unpin npm version once Node 22 ships a bundled npm that can upgrade itself
24+
const NODE22_NPM_VERSION = '11.11.1';
25+
26+
/** Returns the major version number from a Node.js version string (e.g. 'v22.11.0', '20.19.0', 22). */
27+
function nodeMajorVersion(version) {
28+
return semver.coerce(String(version))?.major;
29+
}
30+
2331
const OPERATING_SYSTEMS = [
2432
{
2533
name: DEFAULT_OS,
@@ -397,6 +405,12 @@ for (const {
397405
const expansions = { NODE_LTS_VERSION };
398406
const taskNames = tasks.map(({ name }) => name);
399407

408+
// bundled npm version in node v22.22.2 (v10.9.7) can't upgrade itself to @latest,
409+
// so we need to pin npm version for these variants to latest "upgradable" version
410+
if (nodeMajorVersion(NODE_LTS_VERSION) === 22) {
411+
expansions.NPM_VERSION = NODE22_NPM_VERSION;
412+
}
413+
400414
expansions.CLIENT_ENCRYPTION = String(!!clientEncryption);
401415
expansions.TEST_CSFLE = expansions.CLIENT_ENCRYPTION;
402416

@@ -478,7 +492,9 @@ const unitTestTasks = Array.from(
478492
updateExpansions({
479493
NODE_LTS_VERSION
480494
}),
481-
{ func: 'install dependencies' },
495+
nodeMajorVersion(NODE_LTS_VERSION) === 22
496+
? { func: 'install dependencies', vars: { NPM_VERSION: NODE22_NPM_VERSION } }
497+
: { func: 'install dependencies' },
482498
{ func: 'run unit tests' }
483499
]
484500
};
@@ -812,6 +828,53 @@ BUILD_VARIANTS.push({
812828
tasks: ['.ssl']
813829
});
814830

831+
// small subset of tests to run on nodeless environments
832+
const commonNodelessTasks = [
833+
'test-latest-server',
834+
'test-latest-replica_set',
835+
'test-latest-sharded_cluster',
836+
'test-rapid-server',
837+
'test-rapid-replica_set',
838+
'test-rapid-sharded_cluster',
839+
'test-latest-server-v1-api',
840+
'test-x509-authentication',
841+
'test-atlas-connectivity',
842+
'test-auth-ldap',
843+
'test-socks5-csfle',
844+
'test-socks5-tls',
845+
'test-snappy-compression',
846+
'test-zstd-compression',
847+
'test-tls-support-latest'
848+
];
849+
// small subset of linux-specific tests to run on nodeless environments
850+
const linuxOnlyTests = [
851+
'test-rapid-load-balanced',
852+
'test-latest-load-balanced',
853+
'test-auth-kerberos'
854+
];
855+
856+
const linuxNodelessTasks = commonNodelessTasks.concat(linuxOnlyTests);
857+
858+
const nodelessExpansions = {
859+
NODE_LTS_VERSION: LATEST_LTS,
860+
CLIENT_ENCRYPTION: true,
861+
MONGODB_BUNDLED: true
862+
};
863+
BUILD_VARIANTS.push({
864+
name: 'rhel8-nodeless',
865+
display_name: 'Nodeless',
866+
run_on: DEFAULT_OS,
867+
tasks: linuxNodelessTasks,
868+
expansions: nodelessExpansions
869+
});
870+
BUILD_VARIANTS.push({
871+
name: 'windows-nodeless',
872+
display_name: 'Windows Nodeless',
873+
run_on: WINDOWS_OS,
874+
tasks: commonNodelessTasks,
875+
expansions: nodelessExpansions
876+
});
877+
815878
// TODO(NODE-4897): Debug socks5 tests on node latest
816879
for (const variant of BUILD_VARIANTS.filter(
817880
variant => variant.expansions && ['latest'].includes(variant.expansions.NODE_LTS_VERSION)

.evergreen/run-azure-kms-tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ export MONGODB_URI="mongodb://localhost:27017"
1818
export EXPECTED_AZUREKMS_OUTCOME=${EXPECTED_AZUREKMS_OUTCOME:-omitted}
1919
export TEST_CSFLE=true
2020

21+
npm run build:bundle
22+
2123
npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.19.on_demand_azure.test.ts

.evergreen/run-gcp-kms-tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ export MONGODB_URI="mongodb://localhost:27017"
2020
export EXPECTED_GCPKMS_OUTCOME=${EXPECTED_GCPKMS_OUTCOME:-omitted}
2121
export TEST_CSFLE=true
2222

23+
npm run build:bundle
24+
2325
npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.17.on_demand_gcp.test.ts

.evergreen/run-mongosh-scope-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ export SCOPES=$(./node_modules/lerna/cli.js ls --all --json)
1313

1414
cd -
1515

16+
npm run build:bundle
17+
1618
npx mocha --config test/manual/mocharc.json test/manual/mongosh_scopes.test.ts

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "main", "5.x" ]
5+
branches: [ "main", "v7.1.x" ]
66
pull_request:
7-
branches: [ "main", "5.x" ]
7+
branches: [ "main", "v7.1.x" ]
88

99
jobs:
1010
analyze:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,5 @@ uri.txt
108108
crypt_shared.sh
109109

110110
*keytab
111+
driver.bundle.js
112+
test/tools/runner/bundle/

0 commit comments

Comments
 (0)