-
Notifications
You must be signed in to change notification settings - Fork 51
Support generating summary reports when using pytest-xdist
#242
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
base: main
Are you sure you want to change the base?
Conversation
6ca8c37 to
a4c64a5
Compare
|
@ConorMacBride nice work! The generated html is empty; fixed it locally |
|
Thanks @cvanelteren, I'll try to get this tidied up and released. I think I just need to revert the commit that fixes the pybind11 issue; iirc it only affects one minor matplotlib release so likely cleaner to remove. Do you mean this PR introduces an issue that is causing empty HTML? |
|
Yeah the html was empty for me with the PR. Note that with the applied fixes it was not anymore. |
This reverts commit b66e2a9.
|
have been testing this last couple of weeks -- must say it is very nice to not have to wait 20 minutes for the visual tests to come in 👍 ! |
|
There is a small issue though that pytest-mpl with xdist will cause issue with Note that this is ofc not an issue directly with this PR but more in general that users should be aware of this. |
b470844 to
337005c
Compare
|
@cvanelteren I wasn't able to reproduce the issue with the empty HTML (337005c). What fix did you apply locally? That's a good point on RcParams not being thread safe. Don't think there is anything we can really do on this end except document. |
|
The ones I outlined in the review. I can check again in case I was a bit careless. |
|
Thanks @cvanelteren, I didn't check all parts of the diff as there's a lot of reformatting. I did notice the worker vs controller detection has changed. I tried to rely on the xdist functions to tell us which it was, but it sounds like that might not work well across different xdist and pytest versions. I did notice that the xdist controller function was hitting the exception I have accounted for in the code. Might be best to do the detection ourselves. |
|
Ah I see my editor formatted with black the code without me noticing. The main changes are the one I listed that made it work. I just forked it. To see the full context please see: 8a61c20 but you can ignore the formatting stuff, my bad! |
|
Ah, I see. I applied black to my code and compared to your version to see the differences. I don't think the import changes are needed but I simplified the xdist worker vs controller detection; basically using the short snippet of code that xdist uses itself. The issue was that the JSON summary needs to always be generated for xdist workers such that the results can be shared across processes and merged back into the results object in the controller. I added a test to catch this. |
|
Exactly! Apologies if this wasn't clear. |


mpl-results-pathis not set, ensure temp directory is shared across all workers{results_dir}/results-xdist-{test_run_uid}-{worker_id}.json{results_dir}/results-xdist-{test_run_uid}-*.jsonback into current controller process{results_dir}/results.json(if JSON summaries enabled)This likely won't work for remote xdist workers.
Maybe we need a way to detect that and warn?Will publish a new minor release once merged.
TODO
Closes #136
Closes #239