Skip to content

Commit d0aaa31

Browse files
committed
feat: add test coverage tooling
- Add pytest-cov>=6.0.0 to test dependencies - Add [tool.coverage.run] and [tool.coverage.report] config - Add 'make coverage' target with HTML + terminal reports Current coverage: 79%
1 parent 1c58120 commit d0aaa31

22 files changed

Lines changed: 19 additions & 2 deletions

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := help
2-
.PHONY: help install lint format typecheck quality test all
2+
.PHONY: help install lint format typecheck quality test coverage all
33

44
# Colors (ANSI)
55
YELLOW := \033[33m
@@ -23,6 +23,7 @@ help: ## Show this help message
2323
@printf " $(GREEN)%-18s$(RESET) %s\n" "quality" "Run all code quality checks"
2424
@printf " $(GREEN)%-18s$(RESET) %s\n" "test" "Run Python test suite"
2525
@printf " $(GREEN)%-18s$(RESET) %s\n" "all" "Run all code quality checks and tests"
26+
@printf " $(GREEN)%-18s$(RESET) %s\n" "coverage" "Run tests with coverage report"
2627

2728
install: ## Install balatrobot and all dependencies (including dev)
2829
@$(PRINT) "$(YELLOW)Installing all dependencies...$(RESET)"
@@ -51,5 +52,9 @@ test: ## Run Python test suite
5152
@$(PRINT) "$(YELLOW)Running balatrobench tests...$(RESET)"
5253
@pytest
5354

55+
coverage: ## Run tests with coverage report
56+
@$(PRINT) "$(YELLOW)Running tests with coverage...$(RESET)"
57+
@pytest --cov=balatrobench --cov-report=term-missing --cov-report=html
58+
5459
all: lint format typecheck test ## Run all code quality checks and tests
5560
@$(PRINT) "$(GREEN)✓ All checks completed$(RESET)"

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ markers = [
3535
]
3636

3737
[dependency-groups]
38-
test = ["pytest>=9.0.2"]
38+
test = ["pytest>=9.0.2", "pytest-cov>=6.0.0"]
3939
dev = [
4040
"commitizen>=4.11.0",
4141
"mdformat>=0.7.22,<0.8.0",
@@ -48,3 +48,15 @@ dev = [
4848
"ruff>=0.14.10",
4949
"ty>=0.0.9",
5050
]
51+
52+
[tool.coverage.run]
53+
source = ["src/balatrobench"]
54+
branch = true
55+
56+
[tool.coverage.report]
57+
show_missing = true
58+
exclude_lines = [
59+
"pragma: no cover",
60+
"if TYPE_CHECKING:",
61+
"raise NotImplementedError",
62+
]

tests/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/requests.jsonl renamed to tests/balatrobench/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/requests.jsonl

File renamed without changes.

tests/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/responses.jsonl renamed to tests/balatrobench/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/responses.jsonl

File renamed without changes.

tests/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/stats.json renamed to tests/balatrobench/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/stats.json

File renamed without changes.

tests/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/strategy.json renamed to tests/balatrobench/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/strategy.json

File renamed without changes.

tests/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/task.json renamed to tests/balatrobench/fixtures/runs/v1.0.0/default/openai/gpt-oss-120b/20260109_165752_472_RED_WHITE_BBBBBBB/task.json

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)