-
Notifications
You must be signed in to change notification settings - Fork 586
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
Refactor pytest plugin statistics handling for strict JUnit xml validation #1975
Comments
|
Proof of concept: master...Zac-HD:interoperable-stats Valid against the Not planning to keep working on this, but PRs or sponsored features are always an option. |
|
We've just stumbled upon this issue, because we wanted to remove a custom Are there any updates on this issue besides a POC implementation, that AFAIC doesn't use the |
|
The POC already uses the (underlying implementation of) the new fixture; the problem is that XML-escaping So all we need is for someone to write a whole bunch of tests for this, which I am unmotivated to do at the moment while I'm busy getting HypoFuzz off the ground. Happy to help with and review a PR if someone on your team could write it (based on these tests and whatever xunit xml validation you think appropriate), or as above I could make time if sponsored. |
pytest-dev/pytest#5202 indicates that using the
record_propertyfixture leads Pytest to generate an XML file which is not compliant with some strict schemas. We don't actually use this fixture, but we do hook our statistics data into the underlying data structure so it gets passed between xdist workers correctly.pytest-dev/pytest#5205 proposes to add a fixture with a better way, but we don't need to use the fixture when we can hook into the underlying method directly (which has the advantage of working on earlier versions of Pytest too).
So, in our pytest plugin, I think we could replace the use of
user_propertieswithgetattr(request.config, "_xml", None).add_global_property(name, value)if the_xmlattribute exists. Needs some manual exploration and testing to confirm the idea is sound first, but why not add yet another path for statistics data?(it will also need to be tested, for example, both with and without xdist and checking the resulting xml for content and strict schema compliance)
The text was updated successfully, but these errors were encountered: