GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Upload JUnit Test Reports to Codecov for Enhanced Test Visibility by BahramF73 · Pull Request #13363 · pytest-dev/pytest Conversation
Contributor
DescriptionUpload JUnit test reports to Codecov to enable test result visibility in the Codecov UI. Checklist
ChangelogAdded a new changelog entry: changelog/12689.improvement.rst. Additional NotesThis PR does not fix any specific issue but improves the integration with Codecov by uploading JUnit test reports. Closes #12689
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
nicoddemus
reviewed
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Awesome, yeah, let’s see how it goes! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| - name: Upload test results to Codecov | ||
| if: "matrix.use_coverage" | ||
| uses: codecov/codecov-action@v5 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this works? The docs you've linked mention codecovcli do-upload --report-type test_results under Set up by directly using the CLI, but under Set up using the action they suggest a dedicated codecov/test-results-action@v1 action, including a suggestion to use if: ${{ !cancelled() }} with it. Why not follow that?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You're right. That action is what must be used. I just run one after the other in my projects: https://github.com/tox-dev/workflow/blob/89de3c6/.github/workflows/reusable-tox.yml#L422-L469.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess | ||
| coverage: COVERAGE_FILE={toxinidir}/.coverage | ||
| coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc | ||
| coverage: PYTEST_ADDOPTS=--junitxml=report.xml |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The docs say:
Include the optional
junit_familyflag to have pretty-printed test names in the Codecov UI.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend trying to integrate this in CI only since local runs don't normally need XML files.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1 @@ | |||
| Upload JUnit test reports to Codecov to enable test result visibility in the Codecov UI. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it's confusing to have this as an improvement changelog entry, as that's user-facing improvements. I think contrib would fit much better.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…uration in CI workflow Rename improvement documentation and update test result upload configuration in CI workflow
| coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess | ||
| coverage: COVERAGE_FILE={toxinidir}/.coverage | ||
| coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc | ||
| coverage: PYTEST_ADDOPTS=--junitxml=junit.xml -o junit_family=legacy |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
JUnit isn't coverage, though... Also, is it possible to use long option names?
P.S. It'd be good not to generate this in local runs, but only CI.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It'd be good not to generate this in local runs, but only CI.
TBH I wouldn't care too much... we need however to add junit.xml to .gitignore. However, if it is simple to not generate this for local runs, we can go ahead, but I wouldn't complicate things too much if not.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fair. In my CIs, I have built-in ways of having this separation. Perhaps, one day I'll get to refactoring this one as well...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[TODO] Upload JUnit reports to Codecov
There was an error while loading. Please reload this page.