-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Testsuites tag in Junit xml is not handled #9
Comments
Can you post a XML file to reproduce? The file produced by nosetest looks like this:
which works just fine without iterating over
https://travis-ci.org/kiwitcms/junit.xml-plugin/jobs/532434434 so without an actual reproducer we can't do anything else. |
Here's an example output from Katalon Studio, which I use for automation. ( I deleted some unnecessary text)
Also there's an example at the schema documentation here for the Apache Ant JUnit XML Schema. It seems nosetest uses a different schema than others. |
True that it's not very common to have many testsuites, especially for automated python test runner frameworks (pytest does the same as nose), it is still valid JUnit spec and should be supported. For example, we could add the following, just before the original loop:
|
According to the JUnit XML specs: https://www.ibm.com/support/knowledgecenter/en/SSUFAU_1.0.0/com.ibm.rsar.analysis.codereview.cobol.doc/topics/cac_useresults_junit.html the root element in the XML is a <testsuites> tag. However some of the test runners we've used skip that and have a single <testsuite> tag as their root node. This causes failures for people using some of the other test runners, e.g. - Katalon Studio - exports with the <testsuites> tag - Nose, py.test - export results with the <testsuite> tag
According to the JUnit XML specs: https://www.ibm.com/support/knowledgecenter/en/SSUFAU_1.0.0/com.ibm.rsar.analysis.codereview.cobol.doc/topics/cac_useresults_junit.html the root element in the XML is a <testsuites> tag. However some of the test runners we've used skip that and have a single <testsuite> tag as their root node. This causes failures for people using some of the other test runners, e.g. - Katalon Studio - exports with the <testsuites> tag - Nose, py.test - export results with the <testsuite> tag
According to the JUnit XML specs: https://www.ibm.com/support/knowledgecenter/en/SSUFAU_1.0.0/com.ibm.rsar.analysis.codereview.cobol.doc/topics/cac_useresults_junit.html the root element in the XML is a <testsuites> tag. However some of the test runners we've used skip that and have a single <testsuite> tag as their root node. This causes failures for people using some of the other test runners, e.g. - Katalon Studio - exports with the <testsuites> tag - Nose, py.test - export results with the <testsuite> tag
In order to make this plugin work with the JUnit xmls of my automated tests, I have to remove the XML tag
testsuites
In the JUnitParser documentation (https://pypi.org/project/junitparser/) the example shows the levels correctly:

The plugin on the other hand assumes that after reading the file, the next level are the testcases:
xml = JUnitXml.fromfile(junit_xml) for xml_case in xml: summary = "%s.%s" % (xml_case.classname, xml_case.name)
Please fix it to avoid the extra step before using the plugin.
The text was updated successfully, but these errors were encountered: