chore: skip csfle tests and fix related broken tests#4965
chore: skip csfle tests and fix related broken tests#4965PavelSafronov wants to merge 6 commits into
Conversation
90ffe44 to
bd132cc
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Node.js driver’s CSFLE integration/prose test suite to avoid known MongoDB Server 9.0+ failures by conditionally skipping affected tests based on server version.
Changes:
- Add server-version-based skips for specific FLE2v2 spec tests that fail due to SERVER-91887.
- Restrict certain prose test cases to run only on pre-9.0 servers to avoid known contentionFactor validation failures.
- Fix range explicit encryption prose tests to query the correct dynamic
encrypted${dataType}field names.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| test/integration/client-side-encryption/client_side_encryption.spec.test.ts | Adds semver-gated skips for failing legacy/unified CSFLE spec tests on MongoDB 9.0+ |
| test/integration/client-side-encryption/client_side_encryption.prose.test.ts | Introduces pre-9.0 metadata to skip a contentionFactor-mismatch prose case on 9.0+ |
| test/integration/client-side-encryption/client_side_encryption.prose.27.text_queries.test.ts | Tightens metadata to exclude MongoDB 9.0+ where text preview features / contention validation break tests |
| test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts | Fixes queries to use computed encrypted${dataType} field names instead of a placeholder string |
| // exceeds the collection's configured contention; SERVER-91887 now validates this on 9.0+. | ||
| if ( | ||
| description === 'BypassQueryAnalysis decrypts' && | ||
| semver.satisfies(configuration.version, '>=9.0.0') |
There was a problem hiding this comment.
False positive: that's not how our version filter works, the version 9.0.0-rc0 is seen as 9.0.0 by the tests.
Code: https://github.com/mongodb/node-mongodb-native/blob/csfle-tests-fix/test/tools/runner/filters/mongodb_version_filter.ts#L32
| // configured with contention:0, but libmongocrypt generates random contentionFactor values. | ||
| // SERVER-91887 now rejects payloads whose contentionFactor exceeds configured contention on 9.0+. | ||
| if ( | ||
| semver.satisfies(configuration.version, '>=9.0.0') && |
There was a problem hiding this comment.
False positive
| // exceeds the collection's configured contention; SERVER-91887 now validates this on 9.0+. | ||
| if ( | ||
| description === 'BypassQueryAnalysis decrypts' && | ||
| semver.satisfies(configuration.version, '>=9.0.0') |
There was a problem hiding this comment.
False positive
| // that exceeds contention:0 on 9.0+ (SERVER-91887). | ||
| if ( | ||
| description === 'encryptedFieldsMap is preferred over remote encryptedFields' && | ||
| semver.satisfies(configuration.version, '>=9.0.0') |
There was a problem hiding this comment.
False positive
| const eeMetadataPre90: MongoDBMetadataUI = { | ||
| requires: { | ||
| clientSideEncryption: true, | ||
| mongodb: '>=7.0.0 <9.0.0', |
There was a problem hiding this comment.
False positive
| requires: { | ||
| clientSideEncryption: '>=6.4.0', | ||
| mongodb: '>=8.2.0', | ||
| mongodb: '>=8.2.0 <9.0.0', |
There was a problem hiding this comment.
False positive
| const metadataWithoutSubstringPreview: MongoDBMetadataUI = { | ||
| requires: { | ||
| clientSideEncryption: '>=6.4.0', | ||
| mongodb: '>=8.2.0 <9.0.0', |
There was a problem hiding this comment.
False positive
Description
Summary of Changes
This skips some CSFLE tests against 9.0+, which are currently failing due to https://jira.mongodb.org/browse/SERVER-91887 and https://jira.mongodb.org/browse/DRIVERS-3547
What is the motivation for this change?
Failing tests, caused by a 9.0 server change.
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript