diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44c9d68c03d..19fde709184 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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() diff --git a/changelog/12689.contrib.rst b/changelog/12689.contrib.rst new file mode 100644 index 00000000000..837bdab9140 --- /dev/null +++ b/changelog/12689.contrib.rst @@ -0,0 +1 @@ +Upload JUnit test reports to Codecov to enable test result visibility in the Codecov UI. diff --git a/testing/test_config.py b/testing/test_config.py index bb08c40fef4..c6b6b1e3632 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -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)"""