-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Simplify tests & allow running on individual doc stores #1487
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oryx1729
reviewed
Sep 27, 2021
oryx1729
approved these changes
Sep 27, 2021
This was referenced Sep 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes:
Running the tests locally is currently quite cumbersome as you need to start various external docker containers for elasticsearch, milvus etc.
Let's simplify this and extend the option that was introduced in #1202, to run tests only on a subset or single documentstore.
This means, when calling
pytest . --doc_store_type="memory"
we will run all tests that can be run just with the InMemoryDocumentStore, i.e.:New conventions for creating new tests:
Test should run on all document stores / those supplied in the CLI arg
--doc_store_type
:Use one of the fixtures
document_store
ordocument_store_with_docs
ordocument_store_type
.Do not parameterize it yourself.
Example:
Test is only compatible with certain document stores:
Some tests you don't want to run on all possible document stores. Either because the test is specific to one/few doc store(s) or the test is not really document store related and it's enough to test it on one document store and speed up the execution time.
Example:
Test is not using a
document_store
/ fixture, but still has a hard requirement for a certain document store:Example:
Limitations / future work:
get_document_store()
MockRetriever
introduced intest_faiss_cosine_similarity
. We can check if we can use this one in more places and in general mock more of the expensive components.Status (please check what you already did):