Skip to content

Commit

Permalink
fix(build): fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
manmartgarc committed Apr 28, 2024
1 parent 39a42e6 commit e67e823
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
hatch run types:check
- name: Run tests with pytest
run: |
hatch run +py=${{ matrix.python-version }} all:test
hatch run +py=${{ matrix.python-version }} all:test-cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: coverage.json
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meta": {"format": 2, "version": "7.5.0", "timestamp": "2024-04-28T01:39:23.091404", "branch_coverage": true, "show_contexts": false}, "files": {"src\\stochatreat\\__init__.py": {"executed_lines": [1, 3], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0, "num_branches": 0, "num_partial_branches": 0, "covered_branches": 0, "missing_branches": 0}, "missing_lines": [], "excluded_lines": [], "executed_branches": [], "missing_branches": []}, "src\\stochatreat\\stochatreat.py": {"executed_lines": [1, 3, 5, 6, 8, 10, 13, 78, 83, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 101, 104, 105, 106, 109, 114, 117, 118, 119, 122, 125, 126, 127, 130, 131, 132, 135, 140, 143, 146, 149, 150, 152, 155, 157, 163, 164, 176, 180, 188, 190, 198, 199, 200, 203, 204, 217, 218, 219, 222, 225, 226, 228, 232, 238, 239, 242, 244, 246], "summary": {"covered_lines": 69, "num_statements": 74, "percent_covered": 91.34615384615384, "percent_covered_display": "91", "missing_lines": 5, "excluded_lines": 0, "num_branches": 30, "num_partial_branches": 4, "covered_branches": 26, "missing_branches": 4}, "missing_lines": [110, 111, 115, 116, 136], "excluded_lines": [], "executed_branches": [[88, 89], [88, 91], [91, 92], [93, 94], [93, 96], [96, 97], [96, 104], [104, 105], [104, 109], [109, 114], [114, 117], [117, 118], [117, 122], [125, 126], [125, 130], [130, 131], [130, 135], [135, 140], [149, 150], [149, 176], [157, -157], [157, 157], [157, 163], [188, 190], [188, 217], [190, -190], [190, 190], [190, 198]], "missing_branches": [[91, 104], [109, 110], [114, 115], [135, 136]]}, "src\\stochatreat\\utils.py": {"executed_lines": [1, 2, 3, 5, 7, 19, 22, 26, 29], "summary": {"covered_lines": 9, "num_statements": 13, "percent_covered": 63.1578947368421, "percent_covered_display": "63", "missing_lines": 4, "excluded_lines": 0, "num_branches": 6, "num_partial_branches": 1, "covered_branches": 3, "missing_branches": 3}, "missing_lines": [8, 9, 11, 16], "excluded_lines": [], "executed_branches": [[7, 19], [26, -26], [26, 26], [26, 29]], "missing_branches": [[7, 8], [16, -16], [16, -11]]}, "tests\\test_assignment.py": {"executed_lines": [1, 2, 3, 5, 6, 13, 14, 15, 16, 27, 37, 46, 47, 48, 49, 50, 60, 72, 73, 74, 80, 88, 90, 95, 96, 97, 103, 111, 113, 118, 119, 124, 132, 134, 139, 140, 147, 148, 154, 162, 164, 174, 176, 183, 190, 195, 202, 204, 207, 208, 210, 212, 215, 216, 217, 223, 224, 225, 232, 234, 236, 239, 240, 241, 247, 248, 256, 258, 260, 263, 264, 269, 277, 279, 280, 283, 284, 285, 286, 295, 297, 299, 300, 303, 304, 305, 307, 316, 318, 320, 322, 327, 330, 331, 332, 337, 338, 339, 340, 348, 350, 353, 354, 355, 360, 361, 362, 363, 371, 372, 374, 376], "summary": {"covered_lines": 112, "num_statements": 112, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0, "num_branches": 64, "num_partial_branches": 0, "covered_branches": 64, "missing_branches": 0}, "missing_lines": [], "excluded_lines": [], "executed_branches": [[14, 13], [14, 27], [47, 46], [47, 60], [72, 73], [72, 74], [73, 72], [73, 74], [74, 73], [74, 95], [95, 96], [95, 97], [96, 95], [96, 97], [97, 96], [97, 118], [119, 118], [119, 139], [140, 139], [140, 174], [215, 216], [215, 217], [216, 215], [216, 217], [217, 216], [217, 239], [239, 240], [239, 241], [240, 239], [240, 241], [241, 240], [241, 263], [264, 263], [264, 283], [283, 284], [283, 285], [284, 283], [284, 285], [285, 284], [285, 303], [303, 304], [303, 305], [304, 303], [304, 305], [305, 304], [305, 330], [320, 322], [320, 327], [330, 331], [330, 332], [331, 330], [331, 332], [332, 331], [332, 353], [339, 340], [339, 350], [353, 354], [353, 355], [354, 353], [354, 355], [355, -1], [355, 354], [362, 363], [362, 376]], "missing_branches": []}, "tests\\test_import.py": {"executed_lines": [1, 2, 4], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0, "num_branches": 0, "num_partial_branches": 0, "covered_branches": 0, "missing_branches": 0}, "missing_lines": [], "excluded_lines": [], "executed_branches": [], "missing_branches": []}, "tests\\test_io.py": {"executed_lines": [1, 2, 3, 5, 8, 9, 13, 23, 27, 28, 29, 38, 43, 44, 50, 59, 63, 64, 67, 76, 81, 82, 83, 92, 96, 97, 100, 110, 115, 118, 121, 130, 131, 133, 134, 137, 138, 140, 149, 157, 161, 162, 163, 166, 170, 171, 172, 175, 179, 180, 181, 184, 188, 189, 190, 193, 197, 198, 199, 202, 207, 208, 209, 210, 211, 214, 218, 219, 220, 221, 224, 228, 229, 230, 233, 234, 236, 237, 243, 246, 248, 256, 265, 274, 275, 276, 283, 285, 294, 295, 298, 299, 300, 307, 308, 310, 319, 320, 322, 327, 331, 332, 341], "summary": {"covered_lines": 103, "num_statements": 103, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0, "num_branches": 30, "num_partial_branches": 0, "covered_branches": 30, "missing_branches": 0}, "missing_lines": [], "excluded_lines": [], "executed_branches": [[9, 8], [9, 23], [28, -23], [28, 29], [44, -38], [44, 44], [44, 50], [64, -59], [64, 64], [64, 67], [82, -76], [82, 83], [97, -92], [97, 97], [97, 100], [118, -110], [118, 118], [118, 121], [131, 130], [131, 157], [234, 233], [234, 265], [274, 275], [274, 276], [275, 274], [275, 276], [276, 275], [276, 298], [298, 299], [298, 300], [299, 298], [299, 300], [300, 299], [300, 327]], "missing_branches": []}}, "totals": {"covered_lines": 298, "num_statements": 307, "percent_covered": 96.33867276887872, "percent_covered_display": "96", "missing_lines": 9, "excluded_lines": 0, "num_branches": 130, "num_partial_branches": 5, "covered_branches": 123, "missing_branches": 7}}
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ installer = "uv"
dependencies = ["pytest", "pytest-cov", "pytest-xdist", "coverage[toml]>=6.5"]
[tool.hatch.envs.default.scripts]
test = "pytest -n auto {args:tests}"
test-cov = "pytest -n auto --cov {args:tests}"
test-cov = "pytest --cov={args:tests} --cov-report json -n auto"
cov-report = ["- coverage combine", "coverage report"]
cov = ["test-cov", "cov-report"]

Expand All @@ -57,7 +57,7 @@ python = ["3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.types]
dependencies = ["mypy>=1.0.0"]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/stochatreat tests}"
check = "mypy --install-types --non-interactive {args:stochatreat}"

[tool.coverage.run]
source_pkgs = ["stochatreat", "tests"]
Expand All @@ -66,8 +66,8 @@ parallel = true
omit = ["src/stochatreat/__about__.py"]

[tool.coverage.paths]
stochatreat = ["src/stochatreat", "*/stochatreat/src/stochatreat"]
tests = ["tests", "*/stochatreat/tests"]
stochatreat = ["src/stochatreat", "*/stochatreat/src/stochatreat", "tests"]
tests = ["tests/"]

[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHEKCING"]
Expand Down

0 comments on commit e67e823

Please sign in to comment.