Skip to content

Commit

Permalink
Skip ragas tests if ragas not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Jan 6, 2025
1 parent c2e59b4 commit 24b8c92
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 202 deletions.
6 changes: 5 additions & 1 deletion riotfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2885,7 +2885,11 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
pkgs={"vcrpy": latest, "pytest-asyncio": "==0.21.1"},
venvs=[
Venv(pys="3.7"),
Venv(pys=select_pys(min_version="3.8"), pkgs={"ragas": "==0.1.21", "langchain": latest}),
Venv(
pys=select_pys(min_version="3.8"),
pkgs={"ragas": "==0.1.21", "langchain": latest},
env={"RAGAS_AVAILABLE": "True"},
),
],
),
Venv(
Expand Down
406 changes: 205 additions & 201 deletions tests/llmobs/test_llmobs_ragas_faithfulness_evaluator.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions tests/llmobs/test_llmobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
from tests.utils import override_global_config


RAGAS_AVAILABLE = os.getenv("RAGAS_AVAILABLE", False)


def run_llmobs_trace_filter(dummy_tracer):
with dummy_tracer.trace("span1", span_type=SpanTypes.LLM) as span:
span.set_tag_str(SPAN_KIND, "llm")
Expand Down Expand Up @@ -1743,6 +1746,7 @@ async def test_annotation_context_async_nested(llmobs):
assert span._get_ctx_item(TAGS) == {"foo": "baz", "boo": "bar"}


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

0 comments on commit 24b8c92

Please sign in to comment.