-
Notifications
You must be signed in to change notification settings - Fork 892
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
GODRIVER-3140 Update client-side-encryption spec tests. #1651
base: v1
Are you sure you want to change the base?
Conversation
API Change ReportNo changes found! |
475502f
to
96298c3
Compare
return nil | ||
} | ||
} | ||
return fmt.Errorf("BSON type mismatch for key %s; expected %s, got %s", key, array.String(), actual) |
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.
return fmt.Errorf("BSON type mismatch for key %s; expected %s, got %s", key, array.String(), actual) | |
return fmt.Errorf("BSON type mismatch for key %q; expected %s, got %q", key, array, actual.Type) |
%s
will use the bson.RawValue.String()
method for array. Additionally, suggest using the actual type rather than the value of actual in the error message.
} | ||
return fmt.Errorf("BSON type mismatch for key %s; expected %s, got %s", key, array.String(), actual) | ||
default: | ||
return fmt.Errorf("unsupported $$type: %s", t.String()) |
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.
return fmt.Errorf("unsupported $$type: %s", t.String()) | |
return fmt.Errorf("unsupported $$type: %q", t) |
q
will use the bsontype
String()
method.
@@ -82,7 +82,24 @@ func compareValues(mt *mtest.T, key string, expected, actual bson.RawValue) erro | |||
if typeVal, err := e.LookupErr("$$type"); err == nil { | |||
// $$type represents a type assertion | |||
// for example {field: {$$type: "binData"}} should assert that "field" is an element with a binary value | |||
return checkValueType(mt, key, actual.Type, typeVal.StringValue()) | |||
switch t := typeVal.Type; t { |
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.
Optional. Use a different name for this variable, such as typ
.
mongo/integration/mtest/mongotest.go
Outdated
if t.clientOpts != nil && t.clientOpts.AutoEncryptionOptions != nil && len(t.failPointNames) > 0 { | ||
t.Logf("configureFailPoint is not supported for auto encryption, skipping ClearFailPoints()") | ||
t.failPointNames = t.failPointNames[:0] |
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 added spec tests include both AutoEncryptionOptions
and "configureFailPoint"
, which seems to suggest that "configureFailPoint"
is being run successfully during the test (to enable the failpoint). Does disabling failpoints behave differently than enabling failpoints when AutoEncryptionOptions
are set?
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.
Yes, clearing fail point fails for "mongocrypt error 1: command not supported for auto encryption: configureFailPoint".
^ The issue was caused because of GODRIVER-2123.
9263a71
to
3ddf46a
Compare
a859b1e
to
80e941f
Compare
c4c67dd
to
928555a
Compare
91f87f3
to
4dcc585
Compare
17c4846
to
12fb07c
Compare
GODRIVER-3140
Summary
Update client-side-encryption spec tests, reflecting spec PR #1564.