-
Notifications
You must be signed in to change notification settings - Fork 18
add support for mongo driver v2. #124
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?
add support for mongo driver v2. #124
Conversation
… handshake, ptrutil) from the MongoDB Go Driver
// Use of this source code is governed by an MIT-style license that can be found in | ||
// the THIRD-PARTY-NOTICES file. | ||
|
||
package assert |
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.
Thank you very much for your work.
I see that you copy a lot of code from other packages.
Could you just import them instead of copying?
The driver is a separate module, so there should be no problem.
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.
At first, I also wanted to write unit tests by importing the mongo-driver/v2 package, but this code is in the internal package and cannot be referenced externally. I had no choice but to use a copy-paste approach.
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.
Could you clarify, which internal code or method do you use?
mongo/v2 required go 1.21 so I don't undrstand why do you need go 1.17 copabilities for mongo/v2
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.
Could you clarify, which internal code or method do you use?
mongo/v2 required go 1.21 so I don't undrstand why do you need go 1.17 copabilities for mongo/v2
I copied this from https://github.com/mongodb/mongo-go-driver/tree/v2.0.0/internal. The official version is based on Go 1.18. Taking https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/internal/assert/assertion_compare_go1.17_test.go as an example, the official repository has these Go files, and I brought them all over when I copied the entire folder.
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.
I asked which methods or code lines do you use.
I see that you use mtest.
As I see there is not mtest in v2 but there is MockDeployment.
add support for mongo driver v2