RagLeap
Tests

Tests: ragleap-vectorstores

Test files: 10. Test functions: 109. Described by their authors (docstring or @DisplayName): 23. Where there is no description, the line shows the test name in words and says so.

Latest result: ragleap-vectorstores-tests (3.12) passed 81 passed, 32 skipped, 0 failed CI job ragleap-vectorstores-tests (3.10) passed 81 passed, 32 skipped, 0 failed CI job

test_chroma_backend.py — 12 tests 12 passed, 0 failed, 0 skipped

Tests for ChromaBackend. Uses a real local chromadb PersistentClient against a temp directory (Chroma has no meaningful "fake" - it's already fully local/embedded, so there's no live-credentials gap to skip around, unlike QdrantBackend/PineconeBackend/WeaviateBackend's tests).

  • test_requires_persist_directory passed
    Requires persist directory (no description in the source; shown from the name)
  • test_insert_and_search_dense_shape passed
    Insert and search dense shape (no description in the source; shown from the name)
  • test_search_dense_single_key_filter passed
    Search dense single key filter (no description in the source; shown from the name)
  • test_search_dense_multi_key_filter passed
    Regression guard for the real Chroma constraint (live-verified): a
  • test_search_dense_empty_embedding_returns_empty passed
    Search dense empty embedding returns empty (no description in the source; shown from the name)
  • test_search_sparse_not_supported passed
    Search sparse not supported (no description in the source; shown from the name)
  • test_search_hybrid_falls_back_to_dense passed
    Search hybrid falls back to dense (no description in the source; shown from the name)
  • test_supports_sparse_is_false passed
    Supports sparse is false (no description in the source; shown from the name)
  • test_list_documents passed
    List documents (no description in the source; shown from the name)
  • test_get_document_filename passed
    Get document filename (no description in the source; shown from the name)
  • test_delete_document_removes_registry_entry_and_vectors passed
    Delete document removes registry entry and vectors (no description in the source; shown from the name)
  • test_search_dense_scores_are_on_the_zero_to_one_scale passed
    Regression: the cosine DISTANCE of Chroma runs from 0 (identical) to 2 (opposite). The similarity is mapped
test_datetime_compat.py — 2 tests 2 passed, 0 failed, 0 skipped

Always-run regression tests (no live infrastructure needed) for datetime handling across every backend.

  • test_no_deprecated_or_py311_only_datetime_apis passed
    No deprecated or py311 only datetime apis (no description in the source; shown from the name)
  • test_opensearch_insert_document_runs_without_a_live_server passed
    Opensearch insert document runs without a live server (no description in the source; shown from the name)
test_lancedb_backend.py — 14 tests 14 passed, 0 failed, 0 skipped

Tests for LanceDBBackend. Uses a real local embedded LanceDB database against a temp directory (LanceDB, like Chroma, is already fully local/embedded - no live-credentials gap to skip around).

  • test_requires_uri passed
    Requires uri (no description in the source; shown from the name)
  • test_insert_and_search_dense_shape passed
    Insert and search dense shape (no description in the source; shown from the name)
  • test_search_dense_single_key_filter passed
    Search dense single key filter (no description in the source; shown from the name)
  • test_search_dense_multi_key_filter passed
    LanceDB's where= accepts a native SQL boolean expression, so
  • test_search_dense_empty_embedding_returns_empty passed
    Search dense empty embedding returns empty (no description in the source; shown from the name)
  • test_search_sparse_not_supported passed
    Search sparse not supported (no description in the source; shown from the name)
  • test_search_hybrid_falls_back_to_dense passed
    Search hybrid falls back to dense (no description in the source; shown from the name)
  • test_supports_sparse_is_false passed
    Supports sparse is false (no description in the source; shown from the name)
  • test_list_documents passed
    List documents (no description in the source; shown from the name)
  • test_get_document_filename passed
    Get document filename (no description in the source; shown from the name)
  • test_delete_document_removes_registry_entry_and_vectors passed
    Delete document removes registry entry and vectors (no description in the source; shown from the name)
  • test_insert_chunk_upserts_not_duplicates passed
    Regression guard for the real merge_insert-based upsert path
  • test_init_schema_idempotent passed
    Calling init_schema again (e.g. on reconnect) should reopen the
  • test_search_dense_scores_are_on_the_zero_to_one_scale passed
    Regression: the cosine DISTANCE of LanceDB runs from 0 (identical) to 2 (opposite). The similarity is mapped
test_opensearch_backend.py — 16 tests 0 passed, 0 failed, 16 skipped

Tests for OpenSearchBackend. Uses a real OpenSearch instance with the opensearch-knn plugin - unlike Chroma/LanceDB (embedded, always available) and RedisBackend's dev-container-assumed-present convention, this backend now runs on the developer's local machine (moved off the shared VPS after a real CPU-spike incident, see the vectorstores handoff), so these tests gate on OPENSEARCH_TEST_URL and skip cleanly (not fail) when it isn't set - same pattern as the Upstash tests gating on UPSTASH_VECTOR_REST_URL/TOKEN, rather than Redis's dev-container assumption that a server is always present.

  • test_requires_opensearch_url skipped
    Requires opensearch url (no description in the source; shown from the name)
  • test_insert_and_search_dense_shape skipped
    Insert and search dense shape (no description in the source; shown from the name)
  • test_search_dense_exact_match_score_near_one skipped
    Regression guard for the real live-verified score formula: for
  • test_search_dense_metadata_filter_arbitrary_keys skipped
    Genuine capability difference from Redis: OpenSearch's query DSL
  • test_search_dense_document_id_filter skipped
    Search dense document id filter (no description in the source; shown from the name)
  • test_search_dense_unsupported_filter_keys_raise skipped
    Other caller metadata is stored unindexed, so a filter on it would silently match nothing: it raises instead.
  • test_search_dense_empty_embedding_returns_empty skipped
    Search dense empty embedding returns empty (no description in the source; shown from the name)
  • test_search_sparse_not_supported skipped
    Search sparse not supported (no description in the source; shown from the name)
  • test_search_hybrid_falls_back_to_dense skipped
    Search hybrid falls back to dense (no description in the source; shown from the name)
  • test_supports_sparse_is_false skipped
    Supports sparse is false (no description in the source; shown from the name)
  • test_list_documents skipped
    List documents (no description in the source; shown from the name)
  • test_get_document_filename skipped
    Get document filename (no description in the source; shown from the name)
  • test_delete_document_removes_registry_entry_and_vectors skipped
    Delete document removes registry entry and vectors (no description in the source; shown from the name)
  • test_insert_chunk_upserts_not_duplicates skipped
    Regression guard: indexing with the same deterministic id
  • test_init_schema_idempotent skipped
    Calling init_schema again (e.g. on reconnect) should reuse the
  • test_init_schema_dimension_mismatch_raises skipped
    Regression guard for a real check this backend adds beyond
test_redis_backend.py — 20 tests 20 passed, 0 failed, 0 skipped

Tests for RedisBackend. Uses a real Redis Stack instance (RediSearch module loaded) running in an isolated dev container on port 6380 - separate from any production Redis used for caching/Celery. Each test gets its own random index_name/key_prefix so parallel/repeated runs never collide, and the index is dropped in teardown.

  • test_requires_redis_url passed
    Requires redis url (no description in the source; shown from the name)
  • test_missing_search_module_raises passed
    Regression guard for the real gotcha encountered live: production
  • test_insert_and_search_dense_shape passed
    Insert and search dense shape (no description in the source; shown from the name)
  • test_search_dense_document_id_filter passed
    Search dense document id filter (no description in the source; shown from the name)
  • test_document_id_with_hyphens_is_escaped passed
    Regression guard for the real TAG-escaping gotcha (live-verified):
  • test_search_dense_unsupported_filter_keys_raise passed
    RediSearch only has document_id and tenant_id as filterable fields. Any other key used to be ignored silently,
  • test_search_dense_empty_embedding_returns_empty passed
    Search dense empty embedding returns empty (no description in the source; shown from the name)
  • test_search_sparse_not_supported passed
    Search sparse not supported (no description in the source; shown from the name)
  • test_search_hybrid_falls_back_to_dense passed
    Search hybrid falls back to dense (no description in the source; shown from the name)
  • test_supports_sparse_is_false passed
    Supports sparse is false (no description in the source; shown from the name)
  • test_list_documents passed
    List documents (no description in the source; shown from the name)
  • test_get_document_filename passed
    Get document filename (no description in the source; shown from the name)
  • test_delete_document_removes_registry_entry_and_vectors passed
    Delete document removes registry entry and vectors (no description in the source; shown from the name)
  • test_insert_chunk_upserts_not_duplicates passed
    Regression guard: HSET on the same deterministic key
  • test_init_schema_idempotent passed
    Calling init_schema again (e.g. on reconnect) should reuse the
  • test_default_key_prefix_isolates_different_indexes passed
    Regression guard for a real bug, live-verified: key_prefix used to
  • test_search_dense_scores_are_on_the_zero_to_one_scale passed
    RediSearch returns a cosine DISTANCE in [0, 2]. The similarity is mapped to [0, 1] like the other backends
  • test_redis_tenant_filter_isolates_tenants passed
    Redis tenant filter isolates tenants (no description in the source; shown from the name)
  • test_redis_document_id_and_tenant_id_filters_combine passed
    Redis document id and tenant id filters combine (no description in the source; shown from the name)
  • test_redis_index_created_before_tenant_id_raises_on_a_tenant_filter passed
    Redis index created before tenant id raises on a tenant filter (no description in the source; shown from the name)
test_smoke.py — 1 tests 1 passed, 0 failed, 0 skipped

Smoke test - the package imports cleanly and VectorBackend is always re-exported regardless of which optional backend extras are installed.

  • test_import passed
    Import (no description in the source; shown from the name)
test_tenant_filters.py — 23 tests 23 passed, 0 failed, 0 skipped

Tenant filter contract for every backend: a metadata_filter key must either filter or raise, never be ignored.

  • test_chroma_tenant_filter_returns_only_that_tenant passed
    Chroma tenant filter returns only that tenant (no description in the source; shown from the name)
  • test_chroma_caller_metadata_cannot_override_stored_fields passed
    Chroma caller metadata cannot override stored fields (no description in the source; shown from the name)
  • test_lancedb_tenant_filter_returns_only_that_tenant passed
    Lancedb tenant filter returns only that tenant (no description in the source; shown from the name)
  • test_lancedb_filter_key_cannot_inject_sql passed
    Lancedb filter key cannot inject sql (no description in the source; shown from the name)
  • test_redis_document_id_filter_still_applies passed
    Redis document id filter still applies (no description in the source; shown from the name)
  • test_redis_stores_tenant_id_as_a_field passed
    Redis stores tenant id as a field (no description in the source; shown from the name)
  • test_redis_search_filters_on_tenant_id passed
    Redis search filters on tenant id (no description in the source; shown from the name)
  • test_redis_unsupported_filter_key_raises_instead_of_being_ignored passed
    Redis unsupported filter key raises instead of being ignored (no description in the source; shown from the name)
  • test_opensearch_new_index_maps_tenant_id_as_keyword passed
    Opensearch new index maps tenant id as keyword (no description in the source; shown from the name)
  • test_opensearch_existing_index_gets_the_tenant_id_mapping passed
    Opensearch existing index gets the tenant id mapping (no description in the source; shown from the name)
  • test_opensearch_stores_tenant_id_as_a_top_level_field passed
    Opensearch stores tenant id as a top level field (no description in the source; shown from the name)
  • test_opensearch_search_filters_on_tenant_id passed
    Opensearch search filters on tenant id (no description in the source; shown from the name)
  • test_opensearch_unsupported_filter_key_raises_instead_of_matching_nothing passed
    Opensearch unsupported filter key raises instead of matching nothing (no description in the source; shown from the name)
  • test_upstash_filters_on_tenant_id_inside_its_namespace passed
    Upstash filters on tenant id inside its namespace (no description in the source; shown from the name)
  • test_upstash_filter_key_cannot_inject_a_condition passed
    Upstash filter key cannot inject a condition (no description in the source; shown from the name)
  • test_lancedb_reopens_an_old_table_and_adds_the_tenant_column passed
    Lancedb reopens an old table and adds the tenant column (no description in the source; shown from the name)
  • test_lancedb_untagged_chunks_never_match_a_tenant_filter passed
    Lancedb untagged chunks never match a tenant filter (no description in the source; shown from the name)
  • test_lancedb_tenant_filter_without_the_column_raises passed
    Lancedb tenant filter without the column raises (no description in the source; shown from the name)
  • test_redis_tenant_filter_on_an_index_without_the_field_raises passed
    Redis tenant filter on an index without the field raises (no description in the source; shown from the name)
  • test_opensearch_mapping_update_failure_does_not_break_init passed
    Opensearch mapping update failure does not break init (no description in the source; shown from the name)
  • test_chroma_insert_without_metadata_still_stores_the_chunk_fields passed
    Chroma insert without metadata still stores the chunk fields (no description in the source; shown from the name)
  • test_lancedb_rejects_unknown_filter_keys passed
    Lancedb rejects unknown filter keys (no description in the source; shown from the name)
  • test_redis_combined_filters_are_one_parenthesised_prefilter passed
    Found by the real-server test: two separate (...) groups before =>[KNN ...] are a RediSearch syntax error.
test_upstash_backend.py — 14 tests 0 passed, 0 failed, 14 skipped

Tests for UpstashBackend. Uses a real Upstash Vector index (managed cloud service - no local/embedded mode exists, so unlike Chroma/LanceDB this needs real credentials). Reads UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN from the environment - tests skip cleanly if these aren't set, rather than failing confusingly.

  • test_requires_url_and_token skipped
    Requires url and token (no description in the source; shown from the name)
  • test_init_schema_rejects_dimension_mismatch skipped
    Init schema rejects dimension mismatch (no description in the source; shown from the name)
  • test_insert_and_search_dense_shape skipped
    Insert and search dense shape (no description in the source; shown from the name)
  • test_search_dense_single_key_filter skipped
    Search dense single key filter (no description in the source; shown from the name)
  • test_search_dense_multi_key_filter skipped
    Upstash's filter= is a real SQL-like string, so multi-key filters
  • test_search_dense_empty_embedding_returns_empty skipped
    Search dense empty embedding returns empty (no description in the source; shown from the name)
  • test_search_sparse_not_supported skipped
    Search sparse not supported (no description in the source; shown from the name)
  • test_search_hybrid_falls_back_to_dense skipped
    Search hybrid falls back to dense (no description in the source; shown from the name)
  • test_supports_sparse_is_false skipped
    Supports sparse is false (no description in the source; shown from the name)
  • test_list_documents skipped
    List documents (no description in the source; shown from the name)
  • test_get_document_filename skipped
    Get document filename (no description in the source; shown from the name)
  • test_delete_document_removes_registry_entry_and_vectors skipped
    Delete document removes registry entry and vectors (no description in the source; shown from the name)
  • test_insert_chunk_upserts_not_duplicates skipped
    Regression guard: re-inserting the same document_id/chunk_index
  • test_init_schema_idempotent skipped
    Calling init_schema again should reconnect and re-verify
test_upstash_count_paging.py — 4 tests

Mock-based tests for UpstashBackend.list_documents() chunk counting: no Upstash account needed (the live tests in test_upstash_backend.py skip without credentials). The index is replaced by a fake whose range() pages like the real one: at most `limit` vectors per call and a next_cursor until the prefix scan is finished.

  • test_document_with_more_than_one_page_of_chunks_is_counted_fully
    Document with more than one page of chunks is counted fully (no description in the source; shown from the name)
  • test_small_and_empty_documents_still_count_correctly
    Small and empty documents still count correctly (no description in the source; shown from the name)
  • test_every_page_is_requested_with_the_cursor_prefix_and_namespace
    Every page is requested with the cursor prefix and namespace (no description in the source; shown from the name)
  • test_a_server_that_repeats_the_same_cursor_does_not_loop_forever
    A server that repeats the same cursor does not loop forever (no description in the source; shown from the name)
test_upstash_metadata_precedence.py — 3 tests

Mock-based tests for UpstashBackend.insert_chunk() metadata handling: no Upstash account needed. The index is replaced by a fake that records upsert() calls.

  • test_caller_metadata_cannot_override_the_stored_chunk_fields
    Caller metadata cannot override the stored chunk fields (no description in the source; shown from the name)
  • test_extra_metadata_keys_are_kept_after_the_stored_fields_in_order
    Extra metadata keys are kept after the stored fields in order (no description in the source; shown from the name)
  • test_missing_metadata_and_zero_token_count
    Missing metadata and zero token count (no description in the source; shown from the name)

Compiled by script from the public repository, its CI logs and the GitHub API. To correct something, open an issue.

All tests