Skip to content

Commit

Permalink
Add per file coverage requirement (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggravlingen authored Jul 21, 2024
1 parent ca0d991 commit 718e263
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ jobs:
- name: Run tests
run: |
source .venv/bin/activate
pytest tests --timeout=30 --cov pypmanager --cov-report term-missing
pytest tests --timeout=30 --cov pypmanager --cov-report xml
- name: Run coverage test
run: |
source .venv/bin/activate
coverage json
coverage-threshold
- name: Coverage comment
id: coverage_comment
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,5 @@ data/*.yaml
*debug.csv

prof

coverage.json
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies = [

[project.optional-dependencies]
test = [
"coverage-threshold==0.4.4",
"httpx==0.27.0",
"mypy==1.10.1",
"pre-commit==3.7.1",
Expand Down Expand Up @@ -206,3 +207,38 @@ exclude_lines = [
"if TYPE_CHECKING:",
"@overload",
]

[coverage-threshold]
line_coverage_min = 70
file_line_coverage_min = 70

[coverage-threshold.modules."pypmanager/**/pandas_algorithm.py"]
file_line_coverage_min = 100

[coverage-threshold.modules."pypmanager/analytics/security.py"]
line_coverage_min = 70
file_line_coverage_min = 29

[coverage-threshold.modules."pypmanager/analytics/holding.py"]
line_coverage_min = 70
file_line_coverage_min = 56

[coverage-threshold.modules."pypmanager/general_ledger/shared.py"]
line_coverage_min = 70
file_line_coverage_min = 0

[coverage-threshold.modules."pypmanager/general_ledger/transaction_macro.py"]
line_coverage_min = 70
file_line_coverage_min = 0

[coverage-threshold.modules."pypmanager/ingest/market_data/ft.py"]
line_coverage_min = 55
file_line_coverage_min = 0

[coverage-threshold.modules."pypmanager/ingest/market_data/helpers.py"]
line_coverage_min = 35
file_line_coverage_min = 0

[coverage-threshold.modules."pypmanager/ingest/market_data/morningstar.py"]
line_coverage_min = 57
file_line_coverage_min = 0

0 comments on commit 718e263

Please sign in to comment.