Skip to content

Commit

Permalink
Merge pull request #237 from NeuroBench/feature/coverage-report
Browse files Browse the repository at this point in the history
Implement Coverage Report
  • Loading branch information
ben9809 authored Aug 14, 2024
2 parents 3f6bc15 + 6dea4a1 commit 4d19a3d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,16 @@ jobs:
- name: Run tests
run: |
poetry run pytest
poetry run pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml,!./cache
flags: unittests
name: coverage-neurobench
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,39 @@ testpaths = [
"tests/test_metrics.py",
]

[tool.coverage.run]
branch = true
include = [
"neurobench/*",
]
omit = [
"neurobench/examples/*",
"neurobench/datasets/*",
"neurobench/tests/*",
]

[tool.coverage.report]

exclude_also = [
"def __repr__",
"if self\\.debug",
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]

ignore_errors = true
format = 'markdown'

[tool.coverage.xml]
output = "coverage/reports/coverage.xml"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 4d19a3d

Please sign in to comment.