refactor(opensearch): use async DocumentStore mixin tests#3224
Merged
davidsbatista merged 7 commits intodeepset-ai:mainfrom Apr 28, 2026
Merged
Conversation
Replace duplicated async test methods in TestDocumentStoreAsync with the generic mixin classes from haystack.testing.document_store_async (added in haystack-ai 2.28.0). This eliminates 13 tests that are now provided by: WriteDocumentsAsyncTest, CountDocumentsAsyncTest, FilterDocumentsAsyncTest, CountDocumentsByFilterAsyncTest, CountUniqueMetadataByFilterAsyncTest, DeleteDocumentsAsyncTest, DeleteAllAsyncTest, DeleteByFilterAsyncTest, UpdateByFilterAsyncTest, GetMetadataFieldsInfoAsyncTest, GetMetadataFieldMinMaxAsyncTest, GetMetadataFieldUniqueValuesAsyncTest OpenSearch-specific tests (bm25, embedding, routing, metadata_search, sql, nested fields) are preserved unchanged. Bumps minimum haystack-ai version to >=2.28.0 for document_store_async module availability. Closes deepset-ai#3049
Contributor
|
@Aftabbs thanks for the contribution! Please use the default template to comment on the PR. |
…in haystack v2.28.0 In haystack v2.28.0, CountDocumentsAsyncTest.test_count_not_empty_async is missing the @staticmethod decorator (all other mixin methods have it). Without @staticmethod, pytest binds `document_store` to self (the test instance) instead of injecting it as a fixture, causing an AttributeError. Override the method locally with a correct instance-method signature until haystack ships the fix in a new release.
Contributor
|
The tests are still failing, can you have a look? |
Contributor
davidsbatista
approved these changes
Apr 28, 2026
Contributor
davidsbatista
left a comment
There was a problem hiding this comment.
I fixed the failing tests and did a few adjustments.
This file contains hidden or 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
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.
Related Issues
Proposed Changes:
Replaces 13 duplicated async test methods in
TestDocumentStoreAsyncwith the generic mixin classes fromhaystack.testing.document_store_async(available since haystack-ai 2.28.0).Mixins added:
WriteDocumentsAsyncTestCountDocumentsAsyncTestFilterDocumentsAsyncTestCountDocumentsByFilterAsyncTestCountUniqueMetadataByFilterAsyncTestDeleteDocumentsAsyncTestDeleteAllAsyncTestDeleteByFilterAsyncTestUpdateByFilterAsyncTestGetMetadataFieldsInfoAsyncTestGetMetadataFieldMinMaxAsyncTestGetMetadataFieldUniqueValuesAsyncTestPreserved (OpenSearch-specific): All bm25, embedding, routing, metadata search, SQL, and nested-fields tests remain unchanged — these exercise OpenSearch-specific behaviour not covered by the generic mixins.
Version bump:
haystack-ai>=2.26.1→>=2.28.0(required forhaystack.testing.document_store_asyncmodule).How did you test it?
pytest -v -m integration)Notes for the reviewer
The mixin classes standardise async document store test coverage across integrations. OpenSearch-specific tests (routing, BM25, embedding, SQL, nested fields) are preserved unchanged.
Checklist
refactor: