Skip to content

Upload JUnit Test Reports to Codecov for Enhanced Test Visibility #13363

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ jobs:
if: "matrix.use_coverage"
run: python -m coverage xml

- name: Test with tox (in CI)
run: |
if [ "$CI" = "true" ]; then
tox -- --junitxml=junit.xml -o junit_family=legacy
else
tox
fi

- name: Upload coverage to Codecov
if: "matrix.use_coverage"
uses: codecov/codecov-action@v5
Expand All @@ -268,6 +276,14 @@ jobs:
files: ./coverage.xml
verbose: true

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: false
files: ./junit.xml
verbose: true

check: # This job does nothing and is only used for the branch protection
if: always()

Expand Down
1 change: 1 addition & 0 deletions changelog/12689.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upload JUnit test reports to Codecov to enable test result visibility in the Codecov UI.
8 changes: 6 additions & 2 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2021,8 +2021,12 @@ def test_override_ini_does_not_contain_paths(
) -> None:
"""Check that -o no longer swallows all options after it (#3103)"""
config = _config_for_test
config._preparse(["-o", "cache_dir=/cache", "/some/test/path"])
assert config._override_ini == ["cache_dir=/cache"]
config._preparse(
["-o", "cache_dir=/cache", "-o", "junit_family=legacy", "/some/test/path"]
)
assert sorted(set(config._override_ini)) == sorted(
["cache_dir=/cache", "junit_family=legacy"]
)

def test_multiple_override_ini_options(self, pytester: Pytester) -> None:
"""Ensure a file path following a '-o' option does not generate an error (#3103)"""
Expand Down
Loading