Skip to content

Commit 39b978e

Browse files
committed
test(NODE-4181): sync FLE test fixes for badQueries and types
1 parent ca6ac0d commit 39b978e

File tree

4 files changed

+1383
-151
lines changed

4 files changed

+1383
-151
lines changed

test/spec/client-side-encryption/tests/badQueries.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,12 @@ tests:
476476
filter: { }
477477
update: { $set : { "encrypted_string": [1,2] }}
478478
result:
479-
errorContains: "Cannot encrypt element of type array"
479+
# DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
480+
# "Cannot encrypt element of type array because schema requires that type is one of: [ string ]"
481+
# After it is:
482+
# "Cannot encrypt element of type: array"
483+
# Only check for the common prefix.
484+
errorContains: "Cannot encrypt element of type"
480485
- description: "an insert with encrypted field on _id errors"
481486
clientOptions:
482487
autoEncryptOpts:
@@ -500,7 +505,12 @@ tests:
500505
arguments:
501506
document: { encrypted_string: [ "123", "456"] }
502507
result:
503-
errorContains: "Cannot encrypt element of type array"
508+
# DRIVERS-2272: The expected error message changed in mongocryptd 6.0. Before it was:
509+
# "Cannot encrypt element of type array because schema requires that type is one of: [ string ]"
510+
# After it is:
511+
# "Cannot encrypt element of type: array"
512+
# Only check for the common prefix.
513+
errorContains: "Cannot encrypt element of type"
504514
- description: "an insert with a Timestamp(0,0) value in the top-level fails"
505515
clientOptions:
506516
autoEncryptOpts:
@@ -523,4 +533,4 @@ tests:
523533
filter: {}
524534
fieldName: "encrypted_w_altname"
525535
result:
526-
errorContains: "The distinct key is not allowed to be marked for encryption with a non-UUID keyId"
536+
errorContains: "The distinct key is not allowed to be marked for encryption with a non-UUID keyId"

0 commit comments

Comments
 (0)