-
Notifications
You must be signed in to change notification settings - Fork 244
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
DRIVERS-2630: add e2e testing for search index commands and clarifications to search index spec #1442
Conversation
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.
Tests implemented with success in PHP: tests/Collection/SearchIndexFunctionalTest.php
To improve the coverage, I suggest adding this e2e tests:
- Call to
createSearchIndexes
with an empty list of indexes. - Call
createSearchIndex
withoutname
. It fallbacks to the "default" name.
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.
LGTM. I've updated the PHP implementation following our discussions.
* or language/implementation equivalent. | ||
* | ||
* If drivers are unable to make the IndexView iterable, they MAY opt to provide the options for | ||
* listing search indexes via the `list` method instead of the `Collection.listSearchIndexes` method. | ||
|
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.
After discussion with @dariakp on slack, we decided that a more consistent API is to include the name
in an options object. There were two reasons for this change:
- It's odd to have a set of search index management methods that have a name as the first parameter and an optional second parameter in others. It makes more sense to include an optional name in an "options" object.
- This is more closely aligned with the regular index management API.
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 understand this was already allowed, this is how it is already implemented in PHP.
Co-authored-by: Kevin Albertson <kevin.albertson@mongodb.com>
Do not intend to merge. This was used to help review PR: mongodb/specifications#1442
* add index-management tests From PR mongodb/specifications#1442 * add test search operations and implement without helpers * document management of search indexes
This PR does three things:
The third bullet can be separated into a different PR if necessary.
Node POC: mongodb/node-mongodb-native#3736
Notes
Why have unified tests and prose tests?
The initial plan was to enhance the unified test runner to support the new search index management commands. There ended up being complications integrating support for the new commands into the UTR (the largest issue was that the commands are asynchronous, and return from the server before the changes have finished). The unified tests were already written and expected errors when run against non-Atlas deployments, so they effectively serve as unit tests for drivers without writing another specialized test format. The new prose tests add end-to-end functionality for drivers' implementations.
Why setup/teardown a cluster for each test?
CSOT
These commands should work with CSOT as per the CSOT spec, but looking through the specs repo we don't seem to have tests for every driver helper that supports
timeoutMS
. Consequently, I chose not to add tests for these helpers withtimeoutMS
.Please complete the following before merging: