From f44ac2ff7c454b3b98a3cd79ed7d8c7f108cbb74 Mon Sep 17 00:00:00 2001 From: Travis Herbranson Date: Sun, 24 May 2026 22:58:30 -0400 Subject: [PATCH] test: smoke test reads embedding model from config, not hardcoded literal a-review (gemini, full migration diff) flagged that the smoke test had the embedding model name baked into the SQL count query, decoupling it from the application's configured value. Read it back from `config.embeddings.model` (env override still wins) so the test stays valid if the default ever moves off nomic-embed-text. --- tests/test_smoke_embedding.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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}"