Skip to content

Commit 24b8c92

Browse files
committed
Skip ragas tests if ragas not available
1 parent c2e59b4 commit 24b8c92

8 files changed

+214
-202
lines changed

riotfile.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2885,7 +2885,11 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
28852885
pkgs={"vcrpy": latest, "pytest-asyncio": "==0.21.1"},
28862886
venvs=[
28872887
Venv(pys="3.7"),
2888-
Venv(pys=select_pys(min_version="3.8"), pkgs={"ragas": "==0.1.21", "langchain": latest}),
2888+
Venv(
2889+
pys=select_pys(min_version="3.8"),
2890+
pkgs={"ragas": "==0.1.21", "langchain": latest},
2891+
env={"RAGAS_AVAILABLE": "True"},
2892+
),
28892893
],
28902894
),
28912895
Venv(

tests/llmobs/test_llmobs_ragas_faithfulness_evaluator.py

+205-201
Large diffs are not rendered by default.

tests/llmobs/test_llmobs_service.py

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
from tests.utils import override_global_config
3939

4040

41+
RAGAS_AVAILABLE = os.getenv("RAGAS_AVAILABLE", False)
42+
43+
4144
def run_llmobs_trace_filter(dummy_tracer):
4245
with dummy_tracer.trace("span1", span_type=SpanTypes.LLM) as span:
4346
span.set_tag_str(SPAN_KIND, "llm")
@@ -1743,6 +1746,7 @@ async def test_annotation_context_async_nested(llmobs):
17431746
assert span._get_ctx_item(TAGS) == {"foo": "baz", "boo": "bar"}
17441747

17451748

1749+
@pytest.mark.skipif(not RAGAS_AVAILABLE, reason="Test requires ragas to be available on user env")
17461750
def test_service_enable_starts_evaluator_runner_when_evaluators_exist():
17471751
with override_global_config(dict(_dd_api_key="<not-a-real-api-key>", _llmobs_ml_app="<ml-app-name>")):
17481752
with override_env(dict(_DD_LLMOBS_EVALUATORS="ragas_faithfulness")):

0 commit comments

Comments
 (0)