-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Support alternative xUnit (JUnit) formats #2292
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
Comments
How would that jUnit output be different to the current xUnit output? |
Related to my previous comment, have you tested using the xUnit output? See also https://en.wikipedia.org/wiki/XUnit. |
Yes I have tried the xUnit output using the pybot -x option. One difference is that the xunit report file is missing the top level "testsuites" node. But you might have seen the Junit report file begins with "testsuites" node. |
The problem is that there is no such thing as the standard jUnit format. This is highly annoying. The current format used by RF is based on some jUnit output variation, but there could be others. If you can find statistics that other formats are used a lot more widely, we can consider changing the current format. Alternatively you can create a script that converts the current format to a format understood by tools you use. I don't like the idea of us adding multiple xUnit formats when nobody has bothered to create an official standard. |
ok thanks, will workaround my creating our own custom output. This bug can be closed now. |
After thinking this a little bit more, xUnit format configurable is not a totally impossible idea. I definitely don't want a totally new output, but having an option like
Do you @mverma-va have interest to look at this? |
Anyone interested to add support for xUnit file configuration? If not, I'll close this issue. |
We are using Bamboo and Robot FW. There is only JUnit parser in Bamboo so we'd appreciate to have JUnit output from Robot FW. |
@davidk1: Robot already provides JUnit output, we just use more general xUnit name for it. The problem is that there is no official standard for that format and Robot only implements one variant. I'm fine making xUnit format configurable. See my comment above for what it would require. |
I consider this a valid enhancement and set labels accordingly. Actually getting this implemented requires someone providing a pull request or paying me or someone else for development. |
See #442 for discussion about adding the original xUnit support. |
Just adding for reference that soapui junit xml report is really well formatted and includes most of the required info. |
It would be great if people using xUnit/jUnit outputs would provide a little more information about the current situation about the output "standard":
|
I'm wanting the same thing as @mverma-va. I've been using junit-viewer to view my test outputs, but it doesn't appear to be working with robot generated xunit xml files. I'd love to have this functionality |
I've been using Bamboo's JUnit Parser to get my results listed and that works great. |
@drew-royster: Could test why junit-viewer doesn't work with Robot's xUnit outputs? It would be great if you could try manually changing outputs to make them compatible so that we'd know what kind of changes would be needed. |
It would be great if someone could study what's the current status with different xUnit/jUnit XML outputs. If there are different standards in wide use, we could make it somehow possible to use select which one to use. If there's a dominant standard that's different to what we currently use, we could even consider changing out xUnit output to use that. That could only happen in a major version, though. Anyway, this needs external help from people familiar with this topic or interested to study that. I don't expect the actual implementation to be too complicated. |
The xunit report generated cannot be used in Jenkins Zephyr plugin to update test cases on Jira. Because it uses Junit report or might Xunit report format is not compatible with that plugin. :( |
xUnit and jUnit reports should in theory be the same. The problem is that at least earlier (see #442) there has been no official spec for xUnit/jUnit compatible reports. If there is now, we can either change xUnit output or make it configurable somehow. Someone interested in this topic should study the current situation and report the findings here. |
I seriously doubt jUnit outputs have a standard attribute |
OP's linked description of junit format looks about right - atleast in the form that it can be digested by most of the tooling (eg, jenkins). I have not really used "xUnit" format ever but my understanding is that there are difference (as there are also multiple versions?). As a side comment, even if there is no such thing as "standard" for junit, it would be acceptable if the format is something that CI tools with their report plugins can digest and if im not mistaken, atleast jenkins does have xsd schema defined so it could be used as a basis ? Anyway, I would be interested on picking this up when i have downtime. Somewhat related issues: pytest-dev/pytest#3547 And as i mentioned above, the xunit plugin provides xsd files here that could be used atleast for investigation why current xunit format is not suitable or as a basis for creating junit format: |
Thanks for your investigation @rasjani and hope you have time to look at this more closely at some point. It's interesting, but not really that surprising, to see that other tools are having the same problem. It's super annoying nobody standardizing jUnit/xUnit back in the early days. Do you know the origins of the format Jenkins uses? Jenkins is so ubiquitous that they standardizing to certain format is likely to make their format at least a de-facto standard. |
junit-10.xsd: doesnt validate "hello world" like xunit report produced by robot due to testsuite attribute "skip" not being allowed as it has been removed - only "skipped" is left. junit-9.xsd and junit-8.xsd against the same helloworld xunit report passes validation just fine. So, from atleast my pov, the only thing that should be done for now is to rename "skip" attribute into "skipped" because that should be backwards compatible. Also, at the time of this ticket was created, Pekka's assumption was indeed correct, there should not be huge differences between xunit & junit ;) @KishoreNatesh i think your your issue most likely has nothing to do with the xunit format itself. Looking at the code (https://github.com/jenkinsci/zephyr-for-jira-test-management-plugin/blob/master/src/main/java/com/thed/zephyr/jenkins/utils/rest/TestCaseUtil.java) and the stacktrace you provided, the failure happens with the request response for from zephyr when it tries to assing a test to a cycle. |
@rasjani Is that junit-10.xsd used by Jenkins nowadays? Can you test would it be enough to change |
@pekkaklarck It's used by Jenkins xUnit plugin. When I edit xunitwriter.py L54 and changed skip to skipped, Jenkins doesn't throw that error anymore. junit-10.xsd only allows skipped for testsuite: https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd#L164 junit-9.xsd allowed skip, skips, or skipped: https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-9.xsd#L111 Edit: Just to note, the existing Robot Framework xunit format works with the Jenkins built-in JUnit plugin, just not the xUnit plugin using the JUnit pattern. |
Feed output.xml or xunit.xml to junitth(http://junitth.sourceforge.net) failed, junitth is great tool for reporting, it will be great if robot will support it. JUnit format: update: |
@ewolz3 Did I get it right that if we change Could you @kanchi240 clarify what you mean with the |
@pekkaklarck @kanchi240 regarding missing time attribute: https://issues.jenkins-ci.org/browse/JENKINS-51797 - it was reported as bug in jenkins side and was quickly fixed. |
Did I get these points about the
If I got all that right, then we don't need to do anything, but I don't see problems us adding the |
Have I got these points about Jenkins compatibility right?
If the above points are correct, then we don't need separate jUnit output support nor do we need to make the xUnit output we produce configurable. All we need is simply changing |
By the way, is it a problem that Robot's xUnit output always only contains exactly one |
I did some experimentation with Jenkins addons and here's the findings:
I've provided a patch that fixes this issue.. Also, worth to empasize that when using "xunit" addon, you have to pick "JUnit" format, nothing else will work and doesn't even make sense to support.. |
Thanks @rasjani for investigation! I'll add this RF 3.1 scope and since you apparently have a PR ready I target this to beta 1 that's planned for next Wednesday. PS: The list in your comment may not be correctly formatted. |
Or should we actually submit a new issue about |
Thanks to @rasjani we now got issue #2978 about changing As discussed above, we could also consider adding |
This is due to xunit jenkins plugin not supporting "skip" attribute anymore. If you are using tools such as jenkins, this change will be backwards compatible but if you have some scripting that will try to read the "skip" attribute from testsuite, you need to change that into "skipped". Addresses: #2292 Fixes: #2978
This is due to xunit jenkins plugin not supporting "skip" attribute anymore. If you are using tools such as jenkins, this change will be backwards compatible but if you have some scripting that will try to read the "skip" attribute from testsuite, you need to change that into "skipped". Addresses: robotframework#2292 Fixes: robotframework#2978
DATADOG_API_KEY=api_key DD_ENV=ci datadog-ci junit upload \ ✔ 282 09:17:31 I am getting this error as the parser is looking for testsuites or testsuite in the output xml. How can I fix this? |
Please add support for creating JUnit xml output report, we need this badly. Since most other tool support that.
Like right now we have pybot -x for generating xUnit xml format report files.
Similarly plz add support to generate JUnit xml format report file.
Or maybe point me to some script which will convert robot output.xml to JUnit format (http://llg.cubic.org/docs/junit/)
The text was updated successfully, but these errors were encountered: