-
Notifications
You must be signed in to change notification settings - Fork 67
SWIFT-133 Implement new Count API #331
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
Conversation
465c807 to
9bd3087
Compare
| let testDocs: [Document] | ||
| var tests: [CrudTest] { return try! testDocs.map { try makeCrudTest($0) } } | ||
| var tests: [CrudTest] { return try! | ||
| testDocs.filter { ($0["operation"] as? Document)?["name"] as? String != "count" }.map { try makeCrudTest($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.
this can probably be left as-is, and instead we just skip the test above in doTests. That way all the test skipping is centralized.
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.
doing that would require that we keep around the CountTest type as a placeholder to parse into. the files mix count and countDocuments so we can't skip a whole file, either.
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.
Oh, good point. I actually personally prefer the placeholder approach. Imo we should be able to deserialize all the tests, regardless of which ones we're going to run, and the testing logic should decide which ones get skipped. It feels a little weird here to be inspecting the documents directly right before we deserialize them.
This isn't a huge deal of course, but the placeholder approach is the one I'm taking for the retryable reads tests, so I figured it was worth mentioning here.
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.
that's fine with me, switched to using a placeholder.
069f5b7 to
91ac9fe
Compare
f1b493b to
764a529
Compare
The
count()function forMongoCollectionhas been deprecated and replaced withcountDocuments()andestimatedDocumentCount(). The new API has been added, along with changes to CRUD and other tests.JIRA ticket: https://jira.mongodb.org/browse/SWIFT-133
Evergreen: https://evergreen.mongodb.com/version/5da0c38d32f41762b94647cc