Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4dbd896
initial POC
baileympearson Jan 28, 2026
b790827
lint
baileympearson Jan 28, 2026
1d1c89e
add adapter unit test
baileympearson Jan 28, 2026
58d8976
unit tests and integration tests
baileympearson Jan 28, 2026
9e0e0ff
cleanup implementation, fix tests
baileympearson Feb 2, 2026
0738ef8
comments
baileympearson Feb 2, 2026
dcdbd79
Merge branch 'main' into NODE-7385
baileympearson Feb 2, 2026
358ede2
working POC bundle + context
baileympearson Feb 2, 2026
c8e5888
working POC bundle + context
baileympearson Feb 2, 2026
f82c084
Merge branch 'main' into NODE-7345-2-poc-single-context
tadjik1 Feb 12, 2026
7f2bd34
got some things working, now figuring out the general types in tests
PavelSafronov Feb 19, 2026
875174b
improve tooling and migrate timeout.test.ts to new format
PavelSafronov Feb 19, 2026
7d9cf78
added better message to restricted require error, including the sourc…
PavelSafronov Feb 20, 2026
b17b665
keep wrapper on the same line as the bundle code, so we have accurate…
PavelSafronov Feb 20, 2026
d23ee71
added readme info about the current approach
PavelSafronov Feb 20, 2026
f45d754
minor changes to get unit and integ tests working
PavelSafronov Feb 20, 2026
bb11d48
added a nodeless build variant
PavelSafronov Feb 20, 2026
06273e7
updated imports of all integ tests and added a bunch of new exports t…
PavelSafronov Feb 23, 2026
5756424
readme updates
PavelSafronov Feb 23, 2026
5c3fcfa
more exports and fixes for integ tests
PavelSafronov Feb 23, 2026
1d0bb60
remove logging from vm context, remove runNodelessTests
PavelSafronov Feb 23, 2026
06ee01a
log more info about require error
PavelSafronov Feb 23, 2026
d6a56b8
add console log when require is blocked
PavelSafronov Feb 23, 2026
7cb3e5d
remove .only
PavelSafronov Feb 23, 2026
641cb28
Merge branch 'main' into NODE-7335-bundle-and-barrel-approach-poc
PavelSafronov Feb 23, 2026
3556355
change how we block require calls, log more info
PavelSafronov Feb 23, 2026
8e0da0a
Merge branch 'NODE-7335-bundle-and-barrel-approach-poc' of https://gi…
PavelSafronov Feb 23, 2026
3ebd9dd
simplified path logic for the require check
PavelSafronov Feb 23, 2026
551c70d
update a few more test imports, skip a v8 test in nodeless testing, a…
PavelSafronov Feb 24, 2026
d2fbe57
add a few more exports
PavelSafronov Feb 24, 2026
7a2fda5
add missing export
PavelSafronov Feb 24, 2026
f454070
fix prose test, add unit test for nodeless
PavelSafronov Feb 24, 2026
7bd8b9a
swapped files to remove all import changes, got most non-integ tests …
PavelSafronov Feb 24, 2026
837f71a
remove incorrect import
PavelSafronov Feb 24, 2026
e187769
remove debug calls
PavelSafronov Feb 24, 2026
670f69e
minor fixes
PavelSafronov Feb 25, 2026
4d537b2
pr feedback: remove duplicates
PavelSafronov Feb 25, 2026
e3703f0
script and eslint updated
PavelSafronov Feb 25, 2026
9183a64
pr feedback:
PavelSafronov Feb 26, 2026
a2804c7
Merge branch 'main' into NODE-7335-bundle-and-barrel-approach-poc
PavelSafronov Feb 26, 2026
7907619
Merge branch 'NODE-7335-bundle-and-barrel-approach-poc' of https://gi…
PavelSafronov Feb 27, 2026
76634cb
pr feedback:
PavelSafronov Feb 27, 2026
7c3c25a
pr feedback: remove sandbox.global
PavelSafronov Mar 12, 2026
711d724
pr feedback: use a different approach of allowing requires
PavelSafronov Mar 13, 2026
be87f76
pr feedback: pare down the list of nodeless tasks
PavelSafronov Mar 19, 2026
971cc26
Merge branch 'NODE-7335-bundle-and-barrel-approach-poc' of https://gi…
PavelSafronov Mar 19, 2026
b248512
ci refactor
PavelSafronov Mar 19, 2026
81e9151
fix lint errors
tadjik1 Mar 23, 2026
847c68e
Merge branch 'main' into NODE-7335-bundle-and-barrel-approach-poc
tadjik1 Mar 23, 2026
f32fbec
build fix: export MAX_RETRIES
PavelSafronov Mar 24, 2026
c3ce071
test(NODE-7487): run tests against arbitrary client versions
PavelSafronov Mar 24, 2026
f5ff127
Merge branch 'mongodb:main' into NODE-7487-arbitrary-version-tests
PavelSafronov Mar 25, 2026
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
2 changes: 2 additions & 0 deletions .evergreen/ci_matrix_constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2'];
const COMPAT_TEST_DRIVER_VERSIONS = ['6.20.0', '6.21.0', '7.0.0', 'latest'];
const versions = [
{ codeName: 'iron', versionNumber: '20.19.0' },
{ codeName: 'jod', versionNumber: 22 },
Expand All @@ -23,6 +24,7 @@ const DEBIAN_OS = 'debian11-small';

module.exports = {
MONGODB_VERSIONS,
COMPAT_TEST_DRIVER_VERSIONS,
versions,
NODE_VERSIONS,
LB_VERSIONS,
Expand Down
10 changes: 10 additions & 0 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,16 @@ functions:
args:
- .evergreen/run-atlas-tests.sh

"run explicit version test":
- command: subprocess.exec
type: test
params:
working_dir: "src"
binary: bash
add_expansions_to_env: true
args:
- .evergreen/run-explicit-version-test.sh

"run socks5 tests":
- <<: *assume_secrets_manager_role
- command: subprocess.exec
Expand Down
105 changes: 105 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@ functions:
add_expansions_to_env: true
args:
- .evergreen/run-atlas-tests.sh
run explicit version test:
- command: subprocess.exec
type: test
params:
working_dir: src
binary: bash
add_expansions_to_env: true
args:
- .evergreen/run-explicit-version-test.sh
run socks5 tests:
- command: ec2.assume_role
params:
Expand Down Expand Up @@ -2166,6 +2175,78 @@ tasks:
- func: bootstrap mongo-orchestration
- func: assume secrets manager role
- func: build and test alpine FLE
- name: test-explicit-driver-version-6.20.0
tags:
- explicit-version
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: DRIVER_VERSION, value: 6.20.0}
- {key: NODE_LTS_VERSION, value: 20.19.0}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: auth}
- {key: SSL, value: nossl}
- {key: CLIENT_ENCRYPTION, value: 'false'}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: run explicit version test
- name: test-explicit-driver-version-6.21.0
tags:
- explicit-version
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: DRIVER_VERSION, value: 6.21.0}
- {key: NODE_LTS_VERSION, value: 20.19.0}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: auth}
- {key: SSL, value: nossl}
- {key: CLIENT_ENCRYPTION, value: 'false'}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: run explicit version test
- name: test-explicit-driver-version-7.0.0
tags:
- explicit-version
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: DRIVER_VERSION, value: 7.0.0}
- {key: NODE_LTS_VERSION, value: 20.19.0}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: auth}
- {key: SSL, value: nossl}
- {key: CLIENT_ENCRYPTION, value: 'false'}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: run explicit version test
- name: test-explicit-driver-version-latest
tags:
- explicit-version
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: DRIVER_VERSION, value: latest}
- {key: NODE_LTS_VERSION, value: 20.19.0}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: auth}
- {key: SSL, value: nossl}
- {key: CLIENT_ENCRYPTION, value: 'false'}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: run explicit version test
- name: test-latest-server-noauth
tags:
- latest
Expand Down Expand Up @@ -4022,6 +4103,30 @@ buildvariants:
run_on: rhel80-large
tasks:
- .resource-management
- name: rhel8-explicit-driver-version
display_name: Explicit Driver Version Test (RHEL8)
run_on: rhel80-large
tasks:
- test-explicit-driver-version-6.20.0
- test-explicit-driver-version-6.21.0
- test-explicit-driver-version-7.0.0
- test-explicit-driver-version-latest
- name: windows-explicit-driver-version
display_name: Explicit Driver Version Test (Windows)
run_on: windows-2022-latest-large
tasks:
- test-explicit-driver-version-6.20.0
- test-explicit-driver-version-6.21.0
- test-explicit-driver-version-7.0.0
- test-explicit-driver-version-latest
- name: macos-explicit-driver-version
display_name: Explicit Driver Version Test (macOS 14 ARM)
run_on: macos-14-arm64
tasks:
- test-explicit-driver-version-6.20.0
- test-explicit-driver-version-6.21.0
- test-explicit-driver-version-7.0.0
- test-explicit-driver-version-latest
- name: TLS tests
display_name: TLS smoke tests
run_on: rhel80-large
Expand Down
35 changes: 35 additions & 0 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const semver = require('semver');

const {
MONGODB_VERSIONS,
COMPAT_TEST_DRIVER_VERSIONS,
versions,
NODE_VERSIONS,
LB_VERSIONS,
Expand Down Expand Up @@ -805,6 +806,40 @@ BUILD_VARIANTS.push({
tasks: ['.resource-management']
});

const EXPLICIT_VERSION_TASKS = COMPAT_TEST_DRIVER_VERSIONS.map(driverVersion => ({
name: `test-explicit-driver-version-${driverVersion}`,
tags: ['explicit-version'],
commands: [
updateExpansions({
DRIVER_VERSION: driverVersion,
NODE_LTS_VERSION: LOWEST_LTS,
VERSION: 'latest',
TOPOLOGY: 'server',
AUTH: 'auth',
SSL: 'nossl',
CLIENT_ENCRYPTION: 'false'
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{ func: 'run explicit version test' }
]
}));

SINGLETON_TASKS.push(...EXPLICIT_VERSION_TASKS);

for (const [osName, runOn, displayName] of [
['rhel8', DEFAULT_OS, 'RHEL8'],
['windows', WINDOWS_OS, 'Windows'],
['macos', MACOS_OS, 'macOS 14 ARM']
]) {
BUILD_VARIANTS.push({
name: `${osName}-explicit-driver-version`,
display_name: `Explicit Driver Version Test (${displayName})`,
run_on: runOn,
tasks: EXPLICIT_VERSION_TASKS.map(t => t.name)
});
}

BUILD_VARIANTS.push({
name: 'TLS tests',
display_name: 'TLS smoke tests',
Expand Down
13 changes: 13 additions & 0 deletions .evergreen/run-explicit-version-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -o errexit

source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh

cd "${PROJECT_DIRECTORY}/test/explicit-version-test"
DRIVER_VERSION="${DRIVER_VERSION:-latest}"

echo "=== Installing mongodb@${DRIVER_VERSION} ==="
npm install --no-save "mongodb@${DRIVER_VERSION}"

echo "=== Running explicit version test ==="
node index.mjs
38 changes: 38 additions & 0 deletions test/explicit-version-test/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import os from 'os';
import { readFileSync } from 'fs';
import { MongoClient, ObjectId } from 'mongodb';

async function main() {
const testCluster = 'mongodb+srv://...';
const client = new MongoClient(testCluster);
try {
await client.connect();

const buildInfo = await client.db('admin').command({ buildInfo: 1 });
const { version: driverVersion } = JSON.parse(
readFileSync(new URL('./node_modules/mongodb/package.json', import.meta.url), 'utf8')
);

console.log('Node.js version: ', process.version);
console.log('Driver version: ', driverVersion);
console.log('Server version: ', buildInfo.version);
console.log('OS: ', `${os.type()} ${os.release()} (${os.arch()})`);
console.log('---');

// Basic read smoke test (cluster user has read-only access)
const doc = await client
.db('sample_mflix')
.collection('movies')
.findOne({ _id: new ObjectId('573a1390f29313caabcd42e8') });
if (doc?.title !== 'The Great Train Robbery')
throw new Error(`Unexpected title: ${doc?.title}`);
console.log('Read smoke test: PASS');
} finally {
await client.close();
}
}

main().catch(err => {
console.error(err);
process.exit(1);
});
6 changes: 6 additions & 0 deletions test/explicit-version-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "explicit-version-test",
"version": "1.0.0",
"type": "module",
"private": true
}
Loading