Skip to content

Commit 234354d

Browse files
authored
chore: added an e2e test in Makefile (#76)
1 parent 90db3ba commit 234354d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ run-benchmarks: ## Run benchmarks
3131
test: ## Run tests
3232
@echo "Running tests..."
3333
@pytest tests/unit $(shell if [ -n "$(k)" ]; then echo "-k $(k)"; fi)
34+
test-e2e: ## Run end2end tests
35+
echo "running end2end tests..."
36+
@pytest tests/e2e -s

src/ragas/evaluation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ def evaluate(
3434
later. If the top 3 metrics are provided then it also returns the `ragas_score`
3535
for the entire pipeline.
3636
37+
Raises
38+
------
39+
ValueError
40+
if validation fails because the columns required for the metrics are missing or
41+
if the columns are of the wrong format.
42+
3743
Examples
3844
--------
3945
the basic usage is as follows:

tests/e2e/test_fullflow.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from datasets import load_dataset
2+
3+
from ragas import evaluate
4+
from ragas.metrics import answer_relevancy, context_relevancy, faithfulness
5+
from ragas.metrics.critique import harmfulness
6+
7+
8+
def test_evaluate_e2e():
9+
ds = load_dataset("explodinggradients/fiqa", "ragas_eval")["baseline"]
10+
result = evaluate(
11+
ds.select(range(5)),
12+
metrics=[answer_relevancy, context_relevancy, faithfulness, harmfulness],
13+
)
14+
assert result is not None

0 commit comments

Comments
 (0)