Skip to content

UpdateByFilterAsyncTest, CountDocumentsByFilterAsyncTest, CountUniqueMetadataByFilterAsyncTest #10920

@davidsbatista

Description

@davidsbatista

NOTES:

  • Tests should be written into haystack/testing/document_store_async.py
  • Use async def for all test methods
  • Decorate each test method with @pytest.mark.asyncio
  • Rely on an async-compatible document_store fixture (to be provided by the concrete test class in each integration)
  • Use await on all *_async() calls
  • Use write_documents_async / count_documents_async in setup steps (not the sync variants), so the full async path is exercised end-to-end
  • Open the PR to the async-mixin-tests feature branch

UpdateByFilterAsyncTest(FilterableDocsFixtureMixin)

Mirrors: UpdateByFilterTest

Test Description
test_update_by_filter_async Update meta on matching docs, verify updated and non-updated docs
test_update_by_filter_no_matches_async Filter matches nothing, returns 0, store count unchanged
test_update_by_filter_multiple_fields_async Update multiple meta fields at once
test_update_by_filter_advanced_filters_async AND/OR compound filter updates

Use inspect.signature(document_store.update_by_filter_async) to detect optional refresh parameter.


CountDocumentsByFilterAsyncTest

Mirrors: CountDocumentsByFilterTest

Test Description
test_count_documents_by_filter_simple_async Simple equality filter
test_count_documents_by_filter_compound_async AND filter
test_count_documents_by_filter_no_matches_async Filter matches nothing, returns 0
test_count_documents_by_filter_empty_collection_async Empty store returns 0

CountUniqueMetadataByFilterAsyncTest

Mirrors: CountUniqueMetadataByFilterTest

Test Description
test_count_unique_metadata_by_filter_all_documents_async No filter — distinct counts for all docs across multiple fields
test_count_unique_metadata_by_filter_with_filter_async Simple filter narrows the distinct value counts
test_count_unique_metadata_by_filter_with_multiple_filters_async AND compound filter

Metadata

Metadata

Assignees

Labels

P1High priority, add to the next sprint

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions