diff --git a/tests/test_smoke_embedding.py b/tests/test_smoke_embedding.py index caf18a2..e2f9d0c 100644 --- a/tests/test_smoke_embedding.py +++ b/tests/test_smoke_embedding.py @@ -98,6 +98,15 @@ def test_extraction_round_trip_with_embedding(): extraction_id = ext.id source_id = src.id + # Read the configured model so the test doesn't break if the default + # is changed in settings.toml or via EMBEDDING_MODEL. + from second_brain.config import load_config + + embedding_model = os.environ.get( + "EMBEDDING_MODEL", + load_config().embeddings.get("model", "nomic-embed-text"), + ) + try: n1 = embed_extraction(extraction_id, summary_text) assert n1 is not None and n1 >= 1, f"first embed should write rows, got {n1}" @@ -119,9 +128,9 @@ def test_extraction_round_trip_with_embedding(): WHERE source_schema = 'second_brain' AND source_table = 'extractions' AND source_id = %s - AND embedding_model = 'nomic-embed-text' + AND embedding_model = %s """, - (extraction_id,), + (extraction_id, embedding_model), ) (count,) = cur.fetchone() assert count == n1, f"public.embeddings should hold {n1} rows, has {count}"