As part of deepset-ai/haystack#10799, async test mixin classes are being added to haystack.testing.document_store. Once those are in place, the Elasticsearch integration should inherit the relevant mixins to avoid maintaining duplicate test code.
What needs to be done
In integrations/elasticsearch/tests/test_document_store_async.py, update TestElasticsearchDocumentStoreAsync to inherit the appropriate mixin classes:
from haystack.testing.document_store import (
DocumentStoreBaseExtendedAsyncTests,
CountDocumentsByFilterAsyncTest,
CountUniqueMetadataByFilterAsyncTest,
GetMetadataFieldsInfoAsyncTest,
GetMetadataFieldMinMaxAsyncTest,
GetMetadataFieldUniqueValuesAsyncTest,
)
class TestElasticsearchDocumentStoreAsync(
DocumentStoreBaseExtendedAsyncTests,
CountDocumentsByFilterAsyncTest,
CountUniqueMetadataByFilterAsyncTest,
GetMetadataFieldsInfoAsyncTest,
GetMetadataFieldMinMaxAsyncTest,
GetMetadataFieldUniqueValuesAsyncTest,
):
...
Tests that can be removed (covered by mixins)
test_write_documents_async
test_write_documents_async_invalid_document_type
test_count_documents_async
test_delete_documents_async
test_filter_documents_async
test_delete_all_documents_async
test_delete_all_documents_async_index_recreation
test_delete_all_documents_async_no_index_recreation
test_delete_by_filter_async
test_update_by_filter_async
test_count_documents_by_filter_async
test_count_unique_metadata_by_filter_async
test_get_metadata_fields_info_async
test_get_metadata_field_min_max_async
test_get_metadata_field_unique_values_async
Tests to keep (Elasticsearch-specific)
test_bm25_retrieval_async
test_bm25_retrieval_async_with_filters
test_embedding_retrieval_async
test_embedding_retrieval_async_with_filters
test_write_documents_async_with_sparse_embedding_warning
test_query_sql_async
test_query_sql_async_with_fetch_size
test_query_sql_async_error_handling
Acceptance criteria
As part of deepset-ai/haystack#10799, async test mixin classes are being added to
haystack.testing.document_store. Once those are in place, the Elasticsearch integration should inherit the relevant mixins to avoid maintaining duplicate test code.What needs to be done
In
integrations/elasticsearch/tests/test_document_store_async.py, updateTestElasticsearchDocumentStoreAsyncto inherit the appropriate mixin classes:Tests that can be removed (covered by mixins)
test_write_documents_asynctest_write_documents_async_invalid_document_typetest_count_documents_asynctest_delete_documents_asynctest_filter_documents_asynctest_delete_all_documents_asynctest_delete_all_documents_async_index_recreationtest_delete_all_documents_async_no_index_recreationtest_delete_by_filter_asynctest_update_by_filter_asynctest_count_documents_by_filter_asynctest_count_unique_metadata_by_filter_asynctest_get_metadata_fields_info_asynctest_get_metadata_field_min_max_asynctest_get_metadata_field_unique_values_asyncTests to keep (Elasticsearch-specific)
test_bm25_retrieval_asynctest_bm25_retrieval_async_with_filterstest_embedding_retrieval_asynctest_embedding_retrieval_async_with_filterstest_write_documents_async_with_sparse_embedding_warningtest_query_sql_asynctest_query_sql_async_with_fetch_sizetest_query_sql_async_error_handlingAcceptance criteria
TestElasticsearchDocumentStoreAsyncinherits the relevant async mixin classesdocument_storeasync fixture is correctly wired up