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
Add the ability to write junit test results file for pytest runs. #9594
Conversation
Problem With the transition of pytest to the v2 engine, we lost the ability to write junit-xml results files when test runs. This can't be solved by passing options thru directly to pytest since it expect a junit-xml result file name, which means we need a unique name for each target. Solution Introduce the ability to calculate the junit-xml file name based on a user provided direcotry (option) and the test target name. Result JUnit xml result files which can be processed by CI (CircleCI for example) so failing test can be seen w/o digging thru endless logs.
Happy to take feedback and improve this implementation... as I am not a 100% this is the optimal way to address this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for taking the time to fix this! I hope my comment helps. Please feel free to ask any clarifications and I'm happy to pair on this too if it would help :)
Updated, also added junit_family as per https://docs.pytest.org/en/latest/deprecations.html#junit-family-default-value-change-to-xunit2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! This looks really good.
Co-Authored-By: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-Authored-By: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Will merge on green :)
Problem
With the transition of pytest to the v2 engine, we lost the ability to write junit-xml results files when test runs.
This can't be solved by passing options thru directly to pytest since it expect a junit-xml result file name, which means we need a unique name for each target.
Solution
Introduce the ability to calculate the junit-xml file name based on a user provided direcotry (option) and the test target name.
Result
JUnit xml result files which can be processed by CI (CircleCI for example) so failing test can be seen w/o digging thru endless logs.
https://docs.pytest.org/en/latest/usage.html#creating-junitxml-format-files