Private
Public Access
fix(rag): make test assertion accept either file's content (robust to chroma ordering)
This commit is contained in:
@@ -90,8 +90,17 @@ def test_phase4_final_verify(live_gui, live_gui_workspace):
|
|||||||
for entry in entries:
|
for entry in entries:
|
||||||
if entry.get('role') == 'User' and '## Retrieved Context' in entry.get('content', ''):
|
if entry.get('role') == 'User' and '## Retrieved Context' in entry.get('content', ''):
|
||||||
found_rag = True
|
found_rag = True
|
||||||
print(f"[VERIFY] Found RAG context: {entry.get('content')[:100]}...")
|
content = entry.get('content', '')
|
||||||
assert "Manual Slop RAG is great" in entry.get('content')
|
print(f"[VERIFY] Found RAG context: {content[:100]}...")
|
||||||
|
# Accept either file's content as proof RAG retrieved something.
|
||||||
|
# The original test asserted only the .txt content, but the .py file
|
||||||
|
# ("Manual Slop RAG result") can rank first in batched context
|
||||||
|
# depending on prior chroma state. Either file's content proves
|
||||||
|
# RAG retrieval worked.
|
||||||
|
assert ("Manual Slop RAG is great" in content
|
||||||
|
or "Manual Slop RAG result" in content), (
|
||||||
|
f"Expected either 'Manual Slop RAG is great' or 'Manual Slop RAG result' in retrieved context, got: {content[:200]}"
|
||||||
|
)
|
||||||
break
|
break
|
||||||
assert found_rag, "RAG context not found in history"
|
assert found_rag, "RAG context not found in history"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user