From 692edcdd4ea24ee053b21e75ba0dddc4760a87e5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 20 Sep 2026 10:54:55 +0100 Subject: [PATCH] test(agents): give the graph tool tests the vector store they need The tool now asks graphrag_available(), which wants pgvector as well as the flag. One case set only the flag and passed locally off a dev .env, then failed on CI's faiss default. An autouse fixture sets it for the module, so a case that forgets fails for its own reason; the two about a different vector store override it themselves. --- tests/graphrag/test_graph_search_tool.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/graphrag/test_graph_search_tool.py b/tests/graphrag/test_graph_search_tool.py index 465a1c25..ca2f1330 100644 --- a/tests/graphrag/test_graph_search_tool.py +++ b/tests/graphrag/test_graph_search_tool.py @@ -22,6 +22,17 @@ from docsgpt.core.settings import settings SOURCE = {"active_docs": ["src-1"]} +@pytest.fixture(autouse=True) +def _graph_store_is_pgvector(monkeypatch): + """The graph only exists under pgvector, and CI's default is faiss. + + Set here rather than per test so a case that forgets it fails for its own + reason instead of the gate; the cases about a different vector store + override it in the test body. + """ + monkeypatch.setattr(settings, "VECTOR_STORE", "pgvector") + + class _StubStore: def __init__(self, nodes=None, relationships=None, pages=None): self._nodes = nodes or []