Skip to content

Commit 34a40d2

Browse files
authored
refactor: avoid notebook in test. run all in test-all (#2171)
1 parent da7c854 commit 34a40d2

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ clean: ## Clean all generated files
9999
# =============================================================================
100100

101101
test: ## Run all unit tests
102-
@echo "Running all unit tests (including experimental)..."
102+
@echo "Running all unit tests..."
103103
$(Q)$(MAKE) -C ragas test $(shell if [ -n "$(k)" ]; then echo "k=$(k)"; fi)
104104

105+
test-all: ## Run all unit tests (including notebooks)
106+
@echo "Running all unit tests (including notebooks)..."
107+
$(Q)$(MAKE) -C ragas test-all $(shell if [ -n "$(k)" ]; then echo "k=$(k)"; fi)
108+
105109
test-e2e: ## Run all end-to-end tests
106110
@echo "Running all end-to-end tests..."
107111
$(Q)cd ragas && uv run pytest --nbmake tests/e2e -s

ragas/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ check: format type ## Quick health check (format + type, no tests)
3232

3333
test: ## Run ragas unit tests (including experimental)
3434
@echo "Running ragas unit tests (including experimental)..."
35+
$(Q)uv run pytest tests/unit tests/experimental $(shell if [ -n "$(k)" ]; then echo "-k $(k)"; fi)
36+
37+
test-all: ## Run ragas unit tests with notebook
38+
@echo "Running ragas unit tests..."
3539
$(Q)uv run pytest --nbmake tests/unit tests/experimental $(shell if [ -n "$(k)" ]; then echo "-k $(k)"; fi)
3640

3741
run-ci: ## Run complete CI pipeline for ragas

ragas/tests/unit/test_analytics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ async def agenerate_text( # type: ignore
2727
return LLMResult(generations=[[Generation(text=prompt.to_string())]])
2828

2929

30-
def test_debug_tracking_flag():
30+
def test_debug_tracking_flag(monkeypatch):
3131
import os
3232

3333
from ragas._analytics import RAGAS_DEBUG_TRACKING
3434

35+
monkeypatch.setenv(RAGAS_DEBUG_TRACKING, "true")
3536
assert os.environ.get(RAGAS_DEBUG_TRACKING, "").lower() == "true"
3637

3738

0 commit comments

Comments
 (0)