Skip to content

Commit 333c990

Browse files
test(rag): make RAG server e2e tests opt-in via RAG_E2E
The e2e suite targets a live stack on localhost:9446 with specific env (ENABLE_GRAPH_RAG, etc.), so it fails by default in unit-test runs. Gate the module with a skipif so it only runs when RAG_E2E=1, keeping the default `pytest` run green. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Sri Aradhyula <sraradhy@cisco.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2b149ab commit 333c990

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • ai_platform_engineering/knowledge_bases/rag/server/tests

ai_platform_engineering/knowledge_bases/rag/server/tests/test_e2e.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515
import uuid
1616

1717

18+
# These tests run against a live RAG server started via docker-compose (see the
19+
# module docstring). They mutate real state and assert that the server's runtime
20+
# config matches ENABLE_GRAPH_RAG, so they cannot pass in a plain unit run. They
21+
# are opt-in: set RAG_E2E=1 (with a matching stack up) to enable them. By default
22+
# they are skipped so `pytest tests/` stays green without a live stack.
23+
# assisted-by Cursor claude-opus-4-7
24+
_RAG_E2E_ENABLED = os.getenv("RAG_E2E", "").strip().lower() in {"1", "true", "yes", "on"}
25+
pytestmark = pytest.mark.skipif(
26+
not _RAG_E2E_ENABLED,
27+
reason="Live-stack e2e tests are opt-in; set RAG_E2E=1 with a running docker-compose stack to enable",
28+
)
29+
30+
1831
class TestRAGEndToEnd:
1932
"""End-to-end tests for RAG server functionality."""
2033

0 commit comments

Comments
 (0)