pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Upload junit reports codecov

Open aleguy02 opened this issue 4 months ago • 2 comments

Description

This PR automates uploading JUnit reports to codecov in the test pipeline. An example pipeline run with the changes can be found here (https://github.com/aleguy02/fork-pytest/actions/runs/18184970357). An example of what the codecov UI looks like with these changes can be found here (https://app.codecov.io/gh/aleguy02/fork-pytest/tests).

Closes #12689

Checklist

  • [ ] Include documentation when adding new features.
  • [ ] Include new tests or update existing tests when applicable.
  • [X] Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.

Additional Notes

I didn't create a changelog since the documented behavior of pytest was not modified.

aleguy02 avatar Oct 02 '25 06:10 aleguy02

Do you recommend doing this because it is cleaner to have the entire CLI flag in one place instead of splitting it across the workflow and tox.ini file? If so that makes perfect sense (I'm asking for my personal learning) @webknjaz

aleguy02 avatar Nov 22 '25 18:11 aleguy02

Do you recommend doing this because it is cleaner to have the entire CLI flag in one place instead of splitting it across the workflow and tox.ini file? If so that makes perfect sense (I'm asking for my personal learning)

Perhaps. But this is more due to the fact that configuration should be where it belongs. If you add a --junitxml= to tox.ini, that configuration will also be picked up in local runs, when the contributors invoke tox on their computers. Setting it only in CI prevents that.

webknjaz avatar Nov 25 '25 23:11 webknjaz