Skip to content

Commit eec0ae8

Browse files
committed
Wire test coverage: branch coverage config + CI report
Add [tool.coverage] config (branch coverage, source=pacer_cli, sensible exclude_lines) and run pytest with --cov in CI (term-missing + xml report). Coverage is reported, not gated — the total is dragged down by pre-existing untested modules (reader.py/selection.py 0%, downloader.py 9%), same category as the ruff backlog; the new governance code is well covered (security 93%, courts 86%, config 70%, errors 84%). Ignore coverage.xml artifacts.
1 parent addcba3 commit eec0ae8

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
- name: Dangling-code audit (stubs + swallowed excepts)
4141
run: python tools/audit.py
4242

43-
- name: Run tests
44-
run: pytest tests/ -v --tb=short
43+
- name: Run tests (with coverage)
44+
run: pytest tests/ -v --tb=short --cov=pacer_cli --cov-report=term-missing --cov-report=xml
4545

4646
- name: Run security review tests
4747
run: pytest tests/test_security_review.py -v

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ ENV/
3535
# Testing
3636
.pytest_cache/
3737
.coverage
38+
.coverage.*
39+
coverage.xml
3840
htmlcov/
3941
.tox/
4042
.nox/

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ packages = ["src/pacer_cli"]
6767
testpaths = ["tests"]
6868
pythonpath = ["src"]
6969

70+
[tool.coverage.run]
71+
source = ["pacer_cli"]
72+
branch = true
73+
74+
[tool.coverage.report]
75+
show_missing = true
76+
exclude_lines = [
77+
"pragma: no cover",
78+
"if TYPE_CHECKING:",
79+
"raise NotImplementedError",
80+
"if __name__ == .__main__.:",
81+
"\\.\\.\\.",
82+
]
83+
7084
[tool.ruff]
7185
line-length = 100
7286
target-version = "py310"

0 commit comments

Comments
 (0)