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

Using pytest-github-actions-annotate-failures #3

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
pre-commit run -a

run_unit_integration_and_coverage_tests:
needs: style
# needs: style
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
5 changes: 5 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def run_coverage(session):
set_environment_variables(PYBAMM_ENV, session=session)
session.install("setuptools", silent=False)
session.install("coverage", silent=False)
# Adding a comment
if "CI" in os.environ:
session.install("pytest-github-actions-annotate-failures")
session.install("-e", ".[all,dev,jax]", silent=False)
session.run("pytest", "--cov=pybamm", "--cov-report=xml", "tests/unit")

Expand All @@ -78,6 +81,8 @@ def run_integration(session):
"""Run the integration tests."""
set_environment_variables(PYBAMM_ENV, session=session)
session.install("setuptools", silent=False)
if "CI" in os.environ and sys.version_info[:2] == (3, 12) and sys.platform == "linux":
session.install("pytest-github-actions-annotate-failures")
session.install("-e", ".[all,dev,jax]", silent=False)
session.run("python", "run-tests.py", "--integration")

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_mockfail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_add():
assert 1 + 1 == 0

Check failure on line 2 in tests/unit/test_mockfail.py

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest / Python 3.12)

test_add assert (1 + 1) == 0
prady0t marked this conversation as resolved.
Show resolved Hide resolved
Loading