fix(tests): update 35 failing tests for v3 single-pass pipeline

Tests were written for the old two-pass extraction pipeline (extract
facts + merge with ADD/UPDATE/DELETE). V3 uses single-pass ADD-only
extraction with one LLM call returning {"memory": [...]}.

Changes by category:

Old pipeline tests (13 failures):
- Delete TestHallucinatedIdGuard entirely (tests UPDATE/DELETE ID
  resolution that no longer exists)
- Update error log assertions to match v3 log messages
- Change LLM mock from 2-call side_effect to 1-call return_value
- Update vllm thinking tag tests for single-call format

ensure_json_instruction removed (3):
- Delete source-inspection tests (function still exists in utils
  but is no longer called from _add_to_vector_store)

UTC timestamp normalization removed (2):
- Update expected timestamps to stored-as-is (no UTC conversion)
- Remove _normalize_iso_timestamp_to_utc import

_search_vector_store signature: top_k -> limit (2):
- Update test calls to use limit= parameter

Context manager + close/db removed (6):
- Delete tests for __enter__/__exit__/close/db that were removed

Vector store BM25 config (3):
- Qdrant: add sparse_vectors_config to create_col assertion,
  named vector format {"": vector} in update assertion
- MongoDB: assert_any_call for both vector + text search indexes

Misc (6):
- test_search_handles_incomplete_payloads: expect 1 result (v3
  filters entries without 'data' key)
- Embedding cache tests: update for embed_batch (1 call) vs
  individual embed (was 2 calls)
- Graph reset tests: delete (graph support removed)
- use_azure_credential: update expected sensitivity to True

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chaithanyak42
2026-04-14 02:19:39 +05:30
co-authored by Claude Opus 4.6
parent 2a5ffd0976
commit 0b4bbcefff
8 changed files with 83 additions and 436 deletions
+6 -3
View File
@@ -42,9 +42,12 @@ def test_initalize_create_col(mongo_vector_fixture):
mock_collection.insert_one.assert_called_once_with({"_id": 0, "placeholder": True})
mock_collection.delete_one.assert_called_once_with({"_id": 0})
assert mongo_vector.index_name == "test_collection_vector_index"
mock_collection.list_search_indexes.assert_called_once_with(name="test_collection_vector_index")
mock_collection.create_search_index.assert_called_once()
args, _ = mock_collection.create_search_index.call_args
mock_collection.list_search_indexes.assert_any_call(name="test_collection_vector_index")
mock_collection.list_search_indexes.assert_any_call(name="test_collection_text_search_index")
assert mock_collection.list_search_indexes.call_count == 2
# Two indexes created: vector search + text search
assert mock_collection.create_search_index.call_count == 2
args, _ = mock_collection.create_search_index.call_args_list[0]
search_index_model = args[0].document
assert search_index_model == {
"name": "test_collection_vector_index",
+12 -3
View File
@@ -4,7 +4,7 @@ import unittest
import uuid
from unittest.mock import MagicMock, patch
from qdrant_client import QdrantClient
from qdrant_client import QdrantClient, models
from qdrant_client.models import (
DatetimeRange,
Distance,
@@ -18,6 +18,7 @@ from qdrant_client.models import (
PointStruct,
PointVectors,
Range,
SparseVectorParams,
VectorParams,
)
@@ -59,8 +60,14 @@ class TestQdrant(unittest.TestCase):
expected_config = VectorParams(size=128, distance=Distance.COSINE, on_disk=True)
expected_sparse_config = {
"bm25": SparseVectorParams(modifier=models.Modifier.IDF),
}
self.client_mock.create_collection.assert_called_with(
collection_name="test_collection", vectors_config=expected_config
collection_name="test_collection",
vectors_config=expected_config,
sparse_vectors_config=expected_sparse_config,
)
def test_insert(self):
@@ -231,7 +238,9 @@ class TestQdrant(unittest.TestCase):
self.client_mock.upsert.assert_called_once()
point = self.client_mock.upsert.call_args[1]["points"][0]
self.assertEqual(point.id, vector_id)
self.assertEqual(point.vector, updated_vector)
# v3 uses named vectors: dense vector stored under "" key
self.assertIn("", point.vector)
self.assertEqual(point.vector[""], updated_vector)
self.assertEqual(point.payload, updated_payload)
def test_update_with_none_vector_uses_set_payload(self):