From 9dc55643e99ea3914bd5f78f7800db155133fef1 Mon Sep 17 00:00:00 2001 From: ogt Date: Fri, 10 Jul 2026 00:56:24 +0800 Subject: [PATCH] test(playbook): avoid live rag in service unit tests --- apps/api/tests/test_playbook_service.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/api/tests/test_playbook_service.py b/apps/api/tests/test_playbook_service.py index 1d25b3238..2e31942cf 100644 --- a/apps/api/tests/test_playbook_service.py +++ b/apps/api/tests/test_playbook_service.py @@ -272,7 +272,11 @@ class TestPlaybookService: severity_range=["P1"], ) - recommendations = await service.get_recommendations(symptoms, top_k=3) + recommendations = await service.get_recommendations( + symptoms, + top_k=3, + use_rag=False, + ) assert len(recommendations) == 1 assert recommendations[0].playbook.playbook_id == playbook.playbook_id @@ -293,7 +297,11 @@ class TestPlaybookService: affected_services=["api-gateway"], ) - recommendations = await service.get_recommendations(symptoms, top_k=3) + recommendations = await service.get_recommendations( + symptoms, + top_k=3, + use_rag=False, + ) # Should be empty or have very low similarity assert len(recommendations) == 0 or recommendations[0].similarity_score < 0.4