Skip to content

Use async DocumentStore mixin tests in Valkey #3053

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

What needs to be done

In integrations/valkey/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,
    DeleteDocumentsAsyncTest,
    DeleteAllAsyncTest,
    DeleteByFilterAsyncTest,
    UpdateByFilterAsyncTest,
    CountDocumentsByFilterAsyncTest,
    CountUniqueMetadataByFilterAsyncTest,
    GetMetadataFieldsInfoAsyncTest,
    GetMetadataFieldMinMaxAsyncTest,
    GetMetadataFieldUniqueValuesAsyncTest,
)

Note: The existing Valkey async tests use non-standard naming (e.g. test_async_write_and_count_documents instead of test_write_documents_async). When inheriting the mixins, ensure the mixin tests don't overlap in intent with the remaining store-specific tests.

Tests that can be removed (covered by mixins)

  • test_async_write_and_count_documents → covered by CountDocumentsAsyncTest + WriteDocumentsAsyncTest
  • test_async_write_and_delete_documents → covered by DeleteDocumentsAsyncTest
  • test_async_delete_all_documents → covered by DeleteAllAsyncTest
  • test_async_delete_all_documents_empty_store → covered by DeleteAllAsyncTest
  • 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 (Valkey-specific)

  • test_async_write_exceed_batch_size
  • test_async_write_exact_batch_size
  • test_async_write_multiple_full_batches
  • test_async_overwrite_documents
  • test_async_write_large_batch_performance
  • test_async_search_by_embedding_no_limit
  • test_async_search_by_embedding_with_limit
  • test_async_search_by_embedding_with_category_filter
  • test_async_search_by_embedding_with_numeric_filter
  • test_async_search_by_embedding_with_or_filter
  • test_async_search_by_embedding_with_in_filter
  • test_async_similarity_scores_are_set_correctly
  • test_async_filter_by_meta_score
  • test_async_search_with_meta_score_filter
  • test_get_metadata_field_min_max_empty_store_async (Valkey-specific empty-store edge case)
  • test_get_metadata_field_unique_values_with_search_term_async (Valkey-specific search term behaviour)

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 Valkey-specific tests are preserved
  • The full test suite passes

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions