Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display test coverage reports on PRs #167

Merged
merged 6 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ jobs:
shell: bash -l {0}
run: |
micromamba activate torchquad
cd torchquad/tests
cd torchquad/tests/
pip install pytest
pip install pytest-error-for-skips
pytest -ra --error-for-skips
pip install pytest-cov
pytest -ra --error-for-skips --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=../../torchquad . | tee pytest-coverage.txt
- name: pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./torchquad/tests/pytest-coverage.txt
title: Coverage Report
badge-title: Overall Coverage
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
junitxml-path: ./torchquad/tests/pytest.xml
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ dmypy.json
.pyre/

my_notebooks
.vscode
.vscode
pytest-coverage.txt
pytest.xml
3 changes: 2 additions & 1 deletion torchquad/tests/boole_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

def _run_boole_tests(backend, _precision):
"""Test the integrate function in integration.Boole for the given backend.
Note: For now the 10-D test is diabled due to lack of GPU memory on some computers."""
Note: For now the 10-D test is diabled due to lack of GPU memory on some computers.
"""

bl = Boole()
# 1D Tests
Expand Down
3 changes: 2 additions & 1 deletion torchquad/utils/set_up_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

def _get_default_backend():
"""Get the latest backend which was passed to set_up_backend.
If set_up_backend has never been executed, return "torch" for backwards compatibility"""
If set_up_backend has never been executed, return "torch" for backwards compatibility
"""
return os.environ.get("TORCHQUAD_DEFAULT_BACKEND", "torch")


Expand Down