GODRIVER-3880 Skip QE "prefixPreview" and "suffixPreview" tests on server 9.0.0+.#2378
GODRIVER-3880 Skip QE "prefixPreview" and "suffixPreview" tests on server 9.0.0+.#2378qingyang-hu wants to merge 3 commits intomongodb:masterfrom
Conversation
🧪 Performance ResultsCommit SHA: 621e841The following benchmark tests for version 69fa6985b3404400074bd712 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
API Change ReportNo changes found! |
There was a problem hiding this comment.
Pull request overview
This PR updates the QE prose test for text explicit encryption so prefix/suffix-specific cases are skipped on MongoDB 9.0+ while substring coverage continues to run. It fits into the client-side encryption integration suite by narrowing version applicability for server features that are no longer expected to work on newer servers.
Changes:
- Reworks encrypted collection setup to build the list of test collections conditionally by server version.
- Gates the prefix/suffix query subtests to run only on server versions below 9.0.
- Leaves substring query coverage enabled across supported server versions.
Comments suppressed due to low confidence (1)
internal/integration/client_side_encryption_prose_test.go:3452
- This version gate removes the only coverage for the "contention factor is required" validation on 9.0+, even though
substringPreviewis still exercised on those servers in Cases 5 and 6. Please keep this assertion running on supported servers (for example by usingsubstringPreview) so the validation doesn't become untested on 9.0+.
mt.RunOpts("Case 7: assert contentionFactor is required", mtest.NewOptions().MaxServerVersion("8.99.99"), func(mt *mtest.T) {
encryptedClient, clientEncryption := testSetup()
defer clientEncryption.Close(context.Background())
defer encryptedClient.Disconnect(context.Background())
eo := options.Encrypt().
SetKeyID(key1ID).
SetAlgorithm("TextPreview").
SetQueryType("prefixPreview").
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: "substring", | ||
| fields: readJSONFile(mt, "encryptedFields-substring.json"), |
| if mtest.CompareServerVersions(mtest.ServerVersion(), "9.0.0") < 0 { | ||
| encryptedColls = append(encryptedColls, struct { | ||
| name string | ||
| fields bson.Raw | ||
| }{ | ||
| name: "prefix-suffix", | ||
| fields: readJSONFile(mt, "encryptedFields-prefix-suffix.json"), | ||
| }) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert.ErrorIs(mt, err, mongo.ErrNoDocuments) | ||
| }) | ||
| mt.Run("Case 7: assert contentionFactor is required", func(mt *mtest.T) { | ||
| mt.RunOpts("Case 7: assert contentionFactor is required", mtest.NewOptions().MaxServerVersion("8.99.99"), func(mt *mtest.T) { |
There was a problem hiding this comment.
These commands will change to non-preview on 9.0+, so these tests will not be relevant for 9.0+.
| if coll.name == "prefix-suffix" && mtest.CompareServerVersions(mtest.ServerVersion(), "9.0.0") >= 0 { | ||
| continue |
GODRIVER-3880
Summary
Background & Motivation