Skip to content

Use async DocumentStore mixin tests in Weaviate #3054

@davidsbatista

Description

@davidsbatista

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 Weaviate integration should inherit the relevant mixins to avoid maintaining duplicate test code.

What needs to be done

In integrations/weaviate/tests/test_document_store_async.py, update the async test class to inherit the appropriate mixin classes:

from haystack.testing.document_store import (
    CountDocumentsAsyncTest,
    WriteDocumentsAsyncTest,
    DeleteAllAsyncTest,
    DeleteByFilterAsyncTest,
    UpdateByFilterAsyncTest,
    CountDocumentsByFilterAsyncTest,
    CountUniqueMetadataByFilterAsyncTest,
    GetMetadataFieldsInfoAsyncTest,
    GetMetadataFieldMinMaxAsyncTest,
    GetMetadataFieldUniqueValuesAsyncTest,
)

Note: Weaviate does not appear to implement delete_documents_async or filter_documents_async directly — verify before adding DeleteDocumentsAsyncTest or FilterDocumentsAsyncTest.

Tests that can be removed (covered by mixins)

  • test_write_documents_async
  • test_count_documents_async
  • test_filter_documents_below_default_limit_async
  • test_delete_by_filter_async
  • test_update_by_filter_async
  • test_count_documents_by_filter_async
  • test_get_metadata_fields_info_async
  • test_get_metadata_field_min_max_async
  • test_get_metadata_field_min_max_async_with_meta_prefix
  • test_count_unique_metadata_by_filter_async
  • test_get_metadata_field_unique_values_async
  • test_delete_all_documents_recreate_async
  • test_delete_all_documents_batch_size_async

Tests to keep (Weaviate-specific)

  • test_close_async
  • test_filter_documents_with_blob_data_async
  • test_filter_documents_over_default_limit (Weaviate default limit behaviour)
  • test_write_documents_with_blob_data_async
  • test_bm25_retrieval_async
  • test_bm25_retrieval_async_with_filters
  • test_embedding_retrieval_async
  • test_embedding_retrieval_async_with_filters
  • test_embedding_retrieval_async_distance_and_certainty_error
  • test_hybrid_retrieval_async
  • test_hybrid_retrieval_async_with_filters
  • test_hybrid_retrieval_async_with_alpha
  • test_update_by_filter_async_with_pagination (Weaviate-specific pagination behaviour)
  • test_get_metadata_field_min_max_async_unsupported_type (Weaviate-specific error case)
  • test_get_metadata_field_min_max_async_field_not_found (Weaviate-specific error case)
  • test_count_unique_metadata_by_filter_async_with_meta_prefix
  • test_count_unique_metadata_by_filter_async_no_matches
  • test_count_unique_metadata_by_filter_async_field_not_found
  • test_get_metadata_field_unique_values_async_with_meta_prefix
  • test_get_metadata_field_unique_values_async_with_search_term
  • test_get_metadata_field_unique_values_async_with_pagination
  • test_get_metadata_field_unique_values_async_field_not_found
  • test_get_metadata_field_unique_values_async_empty_result
  • test_delete_all_documents_excessive_batch_size_async (Weaviate-specific batch limit)

Acceptance criteria

  • The async test class inherits the relevant async mixin classes
  • The document_store async fixture is correctly wired up
  • All duplicate tests listed above are removed
  • All Weaviate-specific tests are preserved
  • The full test suite passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions