-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Include <testsuites> root tag in generated XML #5550
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
Include <testsuites> root tag in generated XML #5550
Conversation
Codecov Report
@@ Coverage Diff @@
## features #5550 +/- ##
============================================
+ Coverage 96.1% 96.11% +<.01%
============================================
Files 117 117
Lines 25698 25712 +14
Branches 2494 2495 +1
============================================
+ Hits 24697 24713 +16
+ Misses 696 695 -1
+ Partials 305 304 -1
Continue to review full report at Codecov.
|
Will check out tomorrow! Thanks |
I cannot run the tests on this branch:
|
ah, looks like this is meant to be for python 3.6? I will try that |
Actually, I can't, because the build process is using python 3.7. |
doesn't create an |
It's because I have changed the environment and did not reinstall the lib. |
still getting |
Anyway you can fake the version by setting the |
this works for our Jenkins config. Thanks! |
7bef003
to
a43ba78
Compare
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.
Looks good to me, and apparently it solves the problem too 😄
Is there any we can run a validator that was failing before as part of the Pytest self-tests? That could help detect future regressions on other parts of the schema, and plugins could copy it to check their own use (e.g. IIRC Hypothesis does something iffy-to-the-schema with global properties).
Regardless, I'm happy for this to be merged.
@@ -75,7 +85,7 @@ def tag(self): | |||
return self.__node.tagName | |||
|
|||
@property | |||
def next_siebling(self): | |||
def next_sibling(self): |
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.
Is this public API? If so we should note the change somewhere.
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.
Nope, it is used only on the test. 👍
When do you want to merge this? |
Waiting to see if @nazariyv @jhunkeler want to take a look first. I'm in no rush to merge this as it will only be available in pytest 5.1 anyway, and that's a few weeks off yet. |
Definitely, we plan to tackle this at some point: #5095 |
@nazariyv is also me :) This is my work github user. I guess I will add your branch into my |
Oh, I noticed the first part of the name was similar. 😁
Sure. After we merge this you can then add |
We use pytest to test our company's products, but one of them is stuck using Python 2.7, which means that pytest 4.6.6 seems to be the latest available to us. Our test reporting tool requires xunit 2.0 style output, as described here: According to the pytest docs, using config junit_family = xunit2 should do the trick since pytest 4.2: However, it seems there are bugs (at least this one but maybe others) that make the XML not match the expected style/format. Would you consider making a patch release to pytest 4.6 to include this fix and any similar? |
Include <testsuites> root tag in generated XML
Hi @KellyWalker, Definitely, thanks for the ping, it was an oversight that this one was not backported. Opened a PR with the backport: #6295 Let us know if you notice other bug-fixes that need to be backported. 👍 |
Awesome - thanks! Will it be available in some future 4.6.7? What would be the timing of that release? |
I plan to release mid this week 👍 |
This PR break older Jenkins, do we have the option to revert to the original format? |
@RonnyPfannschmidt this is a point - even for |
@stalkerg actually according to the specification, |
@nicoddemus sorry, seems like it was an internal tool that aggregate test results and it depended on the older pytest format, we changed it and now everything is ok. |
One thing that is not clear to me yet is if the attributes defined in the schema (
name
,title
, etc) are optional:Judging from the other attributes elsewhere which are defined in the schema but are not written (for example,
testsuite
'stimestamp
attribute), it seems those are optional.Fix #5477
@nazariyv @jhunkeler @nazariydolfin
Would appreciate if you folks could help test the XML file produced by this patch and ensuring it still works with your tools (say Jenkins).