-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
name
property on <testsuites>
element in JUnit XML logfile
#5931
name
property on <testsuites>
element in JUnit XML logfile
#5931
Conversation
This commit adds and sets the name property on the testsuites element of the generated JUnit report to 'PHPUnit tests'. This is in line with behaviour in Jest and Vitest where the tools set that property to their respective names.
Can you provide links to Jest and Vitest examples? Thanks. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5931 +/- ##
=========================================
Coverage 94.61% 94.61%
Complexity 6673 6673
=========================================
Files 709 709
Lines 20138 20139 +1
=========================================
+ Hits 19054 19055 +1
Misses 1084 1084 ☔ View full report in Codecov by Sentry. |
Jest doesn't seem to have an example file in their repo but their README contains this example:
here's what an example of vitest would look like, from this file in their repo:
in both cases, the property is customizable, which is where the behaviour of this PR differs from their implementations. |
name
property on <testsuites>
element in JUnit XML logfile
Cherry-picked into |
@joseph-sentry, after upgrading to the latest PHPUnit release, the Jenkins xUnit plugin fails validation as a result of this change and now refuses to process my PHPUnit output:
I can do some post-processing to work around this, of course, and maybe this is a problem that needs to be taken to the xUnit plugin team rather than here -- but I wanted to mention it because I imagine I may not be the only person suddenly experiencing broken builds after this minor update, and it might be helpful to spread awareness. If this could be made configurable, that would be fantastic! |
I think I will just revert this. I do wonder what part of "eXtensible" these plugins do not understand ... |
I think it makes sense to revert this right now. I will take a look at the xunit plugin and see if I can do anything there to make this possible without breaking users' setups. Sorry for the inconvenience! |
Thanks, @joseph-sentry and @sebastianbergmann. I agree that it's strange that xUnit is so strict about validation! I'm certainly not opposed to this change in theory, if we can just find a way to make it coexist peacefully with existing tools. :-) I was able to change a setting to prevent it from totally breaking my builds, but it still refuses to publish my results since it won't try to read a file that fails its validation routine... but I haven't dug too deeply in on that side, so it's certainly possible I'm missing something! (And the fact that it still refers to PHPUnit 4 suggests that it probably hasn't gotten a lot of attention in a long time). |
This commit adds and sets the name property on the testsuites element of the generated JUnit report to 'PHPUnit tests'. This is in line with behaviour in Jest and Vitest where the tools set that property to their respective names.
This is helpful for processing JUnit XMLs depending on the framework that
generated the file.