-
Notifications
You must be signed in to change notification settings - Fork 81
WIP chore(e2e-tests): add queryable encryption suffix/prefix/substring tests MONGOSH-1351 #2534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds end-to-end tests for queryable encryption substring, prefix, and suffix search functionality in MongoDB 8.2+. The changes implement comprehensive test coverage for the new substring search features in queryable encryption.
- Adds new test context for MongoDB 8.2+ substring search features
- Implements tests for prefix, suffix, and substring search operations with queryable encryption
- Sets up shared test infrastructure for encrypted collections with substring query support
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
||
it('allows queryable encryption with substring searches', async function () { | ||
// Insert test data for substring searches | ||
// Insert test data for prefix searches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment 'Insert test data for prefix searches' is incorrect for a substring search test. It should be 'Insert test data for substring searches'.
// Insert test data for prefix searches | |
// Insert test data for substring searches |
Copilot uses AI. Check for mistakes.
const prefixResults = await shell.executeLine( | ||
'coll.find({$expr: { $and: [{$encStrContains: {substring: "admin_", input: "$data"}}] }}, { __safeContent__: 0 }).toArray()' | ||
); | ||
expect(prefixResults).to.have.length(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test expects 2 results but then checks for 3 specific strings. This will cause the test to fail since 'admin_explicit_test.pdf' is the third result but the length assertion expects only 2.
expect(prefixResults).to.have.length(2); | |
expect(prefixResults).to.have.length(3); |
Copilot uses AI. Check for mistakes.
const substringResults = await shell.executeLine( | ||
'coll.find({$expr: { $and: [{$encStrContains: {substring: "user", input: "$data"}}] }}, { __safeContent__: 0 }).toArray()' | ||
); | ||
expect(substringResults).to.have.length(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same query is executed twice with identical parameters but different expected result counts (2 vs 3). This is logically inconsistent since the same query should return the same results.
Copilot uses AI. Check for mistakes.
562f52a
to
9958221
Compare
9958221
to
6a40bdc
Compare
Very WIP - Will probably need a few iterations