Skip to content

Commit e266374

Browse files
authored
Merge pull request #167 from esa/test-coverage
Display test coverage reports on PRs
2 parents f820796 + fb995a0 commit e266374

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/run_tests.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,20 @@ jobs:
5151
shell: bash -l {0}
5252
run: |
5353
micromamba activate torchquad
54-
cd torchquad/tests
54+
cd torchquad/tests/
5555
pip install pytest
5656
pip install pytest-error-for-skips
57-
pytest -ra --error-for-skips
57+
pip install pytest-cov
58+
pytest -ra --error-for-skips --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=../../torchquad . | tee pytest-coverage.txt
59+
- name: pytest coverage comment
60+
uses: MishaKav/pytest-coverage-comment@main
61+
with:
62+
pytest-coverage-path: ./torchquad/tests/pytest-coverage.txt
63+
title: Coverage Report
64+
badge-title: Overall Coverage
65+
hide-badge: false
66+
hide-report: false
67+
create-new-comment: false
68+
hide-comment: false
69+
report-only-changed-files: false
70+
junitxml-path: ./torchquad/tests/pytest.xml

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,6 @@ dmypy.json
129129
.pyre/
130130

131131
my_notebooks
132-
.vscode
132+
.vscode
133+
pytest-coverage.txt
134+
pytest.xml

0 commit comments

Comments
 (0)