Skip to content

Commit 6b7e186

Browse files
ci(NODE-5424): add CI testing for FLE 6.0 with driver latest (#3802)
Co-authored-by: Durran Jordan <durran@gmail.com>
1 parent 1e96e49 commit 6b7e186

File tree

7 files changed

+88
-16
lines changed

7 files changed

+88
-16
lines changed

.evergreen/config.in.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ functions:
352352
SKIP_DEPS=${SKIP_DEPS|1} \
353353
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
354354
355+
"install package":
356+
- command: shell.exec
357+
params:
358+
working_dir: src
359+
script: |
360+
npm install --force ${PACKAGE}
361+
355362
"run lint checks":
356363
- command: subprocess.exec
357364
type: test

.evergreen/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ functions:
316316
COMPRESSOR="${COMPRESSOR}" \
317317
SKIP_DEPS=${SKIP_DEPS|1} \
318318
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
319+
install package:
320+
- command: shell.exec
321+
params:
322+
working_dir: src
323+
script: |
324+
npm install --force ${PACKAGE}
319325
run lint checks:
320326
- command: subprocess.exec
321327
type: test
@@ -2745,6 +2751,24 @@ tasks:
27452751
- func: run custom csfle tests
27462752
vars:
27472753
CSFLE_GIT_REF: master
2754+
- name: test-latest-driver-mongodb-client-encryption-6.0.0
2755+
tags:
2756+
- run-custom-dependency-tests
2757+
commands:
2758+
- func: install dependencies
2759+
vars:
2760+
NODE_LTS_VERSION: 16
2761+
- func: bootstrap mongo-orchestration
2762+
vars:
2763+
VERSION: '7.0'
2764+
TOPOLOGY: replica_set
2765+
- func: bootstrap kms servers
2766+
- func: install package
2767+
vars:
2768+
PACKAGE: mongodb-client-encryption@6.0.0-alpha.3
2769+
- func: run tests
2770+
vars:
2771+
CLIENT_ENCRYPTION: true
27482772
- name: test-latest-server-noauth
27492773
tags:
27502774
- latest
@@ -3676,6 +3700,7 @@ buildvariants:
36763700
- test-auth-ldap
36773701
- test-auth-oidc
36783702
- test-socks5
3703+
- test-socks5-csfle
36793704
- test-socks5-tls
36803705
- test-tls-support-latest
36813706
- test-tls-support-6.0
@@ -3726,6 +3751,7 @@ buildvariants:
37263751
- test-auth-ldap
37273752
- test-auth-oidc
37283753
- test-socks5
3754+
- test-socks5-csfle
37293755
- test-socks5-tls
37303756
- test-tls-support-latest
37313757
- test-tls-support-6.0
@@ -4015,6 +4041,7 @@ buildvariants:
40154041
- run-custom-csfle-tests-rapid-master
40164042
- run-custom-csfle-tests-latest-pinned-commit
40174043
- run-custom-csfle-tests-latest-master
4044+
- test-latest-driver-mongodb-client-encryption-6.0.0
40184045
- name: rhel8-test-serverless
40194046
display_name: Serverless Test
40204047
run_on: rhel80-large

.evergreen/generate_evergreen_tasks.js

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,39 @@ for (const version of ['5.0', 'rapid', 'latest']) {
677677
}
678678
}
679679

680+
oneOffFuncAsTasks.push({
681+
name: `test-latest-driver-mongodb-client-encryption-6.0.0`,
682+
tags: ['run-custom-dependency-tests'],
683+
commands: [
684+
{
685+
func: 'install dependencies',
686+
vars: {
687+
NODE_LTS_VERSION: LOWEST_LTS
688+
}
689+
},
690+
{
691+
func: 'bootstrap mongo-orchestration',
692+
vars: {
693+
VERSION: '7.0',
694+
TOPOLOGY: 'replica_set'
695+
}
696+
},
697+
{ func: 'bootstrap kms servers' },
698+
{
699+
func: 'install package',
700+
vars: {
701+
PACKAGE: 'mongodb-client-encryption@6.0.0-alpha.3'
702+
}
703+
},
704+
{
705+
func: 'run tests',
706+
vars: {
707+
CLIENT_ENCRYPTION: true
708+
}
709+
}
710+
]
711+
});
712+
680713
const coverageTask = {
681714
name: 'download and merge coverage'.split(' ').join('-'),
682715
tags: [],
@@ -781,13 +814,6 @@ for (const variant of BUILD_VARIANTS.filter(
781814
variant.tasks = variant.tasks.filter(name => !['test-socks5'].includes(name));
782815
}
783816

784-
// TODO(NODE-5283): fix socks5 fle tests on node 20+
785-
for (const variant of BUILD_VARIANTS.filter(
786-
variant => variant.expansions && [20].includes(variant.expansions.NODE_LTS_VERSION)
787-
) ) {
788-
variant.tasks = variant.tasks.filter(name => !['test-socks5-csfle'].includes(name));
789-
}
790-
791817
const fileData = yaml.load(fs.readFileSync(`${__dirname}/config.in.yml`, 'utf8'));
792818
fileData.tasks = (fileData.tasks || [])
793819
.concat(BASE_TASKS)

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@mongodb-js/zstd": "^1.1.0",
3737
"gcp-metadata": "^5.2.0",
3838
"kerberos": "^2.0.1",
39-
"mongodb-client-encryption": ">=6.0.0-alpha.1 <7",
39+
"mongodb-client-encryption": ">=6.0.0-alpha.3 <7",
4040
"snappy": "^7.2.2",
4141
"socks": "^2.7.1"
4242
},
@@ -98,7 +98,7 @@
9898
"js-yaml": "^4.1.0",
9999
"mocha": "^10.2.0",
100100
"mocha-sinon": "^2.1.2",
101-
"mongodb-client-encryption": "6.0.0-alpha.1",
101+
"mongodb-client-encryption": "6.0.0-alpha.3",
102102
"mongodb-legacy": "^5.0.0",
103103
"nyc": "^15.1.0",
104104
"prettier": "^2.8.8",

test/tools/runner/filters/client_encryption_filter.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
const { readFileSync } = require('fs');
4+
const { resolve } = require('path');
35
const process = require('process');
46

57
/**
@@ -25,13 +27,20 @@ class ClientSideEncryptionFilter {
2527
}
2628
}
2729

30+
const { version } = JSON.parse(
31+
readFileSync(
32+
resolve(__dirname, '../../../../node_modules/mongodb-client-encryption', 'package.json')
33+
)
34+
);
35+
2836
this.enabled = !!(CSFLE_KMS_PROVIDERS && mongodbClientEncryption);
2937

3038
// Adds these fields onto the context so that they can be reused by tests
3139
context.clientSideEncryption = {
3240
enabled: this.enabled,
3341
mongodbClientEncryption,
34-
CSFLE_KMS_PROVIDERS
42+
CSFLE_KMS_PROVIDERS,
43+
version
3544
};
3645

3746
callback();

test/tools/runner/hooks/configuration.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ const testConfigBeforeHook = async function () {
156156
serverless: process.env.SERVERLESS === '1',
157157
auth: process.env.AUTH === 'auth',
158158
tls: process.env.SSL === 'ssl',
159-
csfle: this.configuration.clientSideEncryption.enabled,
159+
csfle: {
160+
enabled: this.configuration.clientSideEncryption.enabled,
161+
version: this.configuration.clientSideEncryption.version
162+
},
160163
serverApi: MONGODB_API_VERSION,
161164
atlas: process.env.ATLAS_CONNECTIVITY != null,
162165
aws: MONGODB_URI.includes('authMechanism=MONGODB-AWS'),

0 commit comments

Comments
 (0)