Skip to content
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

verify how badly we got junit-xml wrong #1126

Closed
RonnyPfannschmidt opened this issue Oct 10, 2015 · 13 comments
Closed

verify how badly we got junit-xml wrong #1126

RonnyPfannschmidt opened this issue Oct 10, 2015 · 13 comments
Labels
plugin: junitxml related to the junitxml builtin plugin topic: reporting related to terminal output and user-facing messages and errors type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog

Comments

@RonnyPfannschmidt
Copy link
Member

according to the relax Schema's at http://help.catchsoftware.com/display/ET/JUnit+Format
we have quite a lot of the elements we should have at the suite level at a testcase level

@RonnyPfannschmidt RonnyPfannschmidt added type: question general question, might be closed after 2 weeks of inactivity topic: reporting related to terminal output and user-facing messages and errors threads type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog labels Oct 10, 2015
@dnozay
Copy link

dnozay commented Mar 2, 2016

Hi, I am currently maintaining unittest-xml-reporting https://github.com/xmlrunner/unittest-xml-reporting.

I don't have a solution to the issue, but I was trying to figure out the open issues with the junitxml plugin and see if (license issues aside) there is some collaboration that can happen. Maybe the junitxml plugin can leverage unittest-xml-reporting; contributions from some of you would be welcome too.

@RonnyPfannschmidt
Copy link
Member Author

I am interested in completely externalizing the junitxml plugin in the pytest 3.x series

@RonnyPfannschmidt
Copy link
Member Author

according to the xsd, im reasonably sure we got the properties wrong

@nicoddemus nicoddemus added plugin: junitxml related to the junitxml builtin plugin and removed plugin: junitxml related to the junitxml builtin plugin labels Feb 2, 2017
@nicoddemus nicoddemus removed the type: question general question, might be closed after 2 weeks of inactivity label Jan 23, 2018
@jrd
Copy link

jrd commented Jun 13, 2018

According to this https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd
skipped property is mandatory in testsuite tag.
This definition schema is the one used in jenkins junit/xunit plugins

@gtmanfred
Copy link

Any chance of getting this fixed? We are currently having to downgrade xunit in jenkins because of this.

Thanks,
Daniel

@RonnyPfannschmidt
Copy link
Member Author

@gtmanfred nobody is working on it

@icemac
Copy link

icemac commented Aug 3, 2018

There is also #1862 which seems to describe the same problem.

@ringods
Copy link

ringods commented Dec 13, 2018

The main thing I find missing in the currently output XML is that the top-level testsuites (plural!) tag is missing. The Schema allows for that and it would already render more sections in tools that post process the XML file, e.g. ReportPortal.

Current:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite disabled="" errors="" failures="" hostname="" id=""
           name="" package="" skipped="" tests="" time="" timestamp="">
    <testcase assertions="" classname="" name="" status="" time=""></testcase>
    <testcase assertions="" classname="" name="" status="" time=""></testcase>
    ...
</testsuite>

Allowed:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites disabled="" errors="" failures="" name="" tests="" time="">
    <testsuite disabled="" errors="" failures="" hostname="" id=""
               name="" package="" skipped="" tests="" time="" timestamp="">
        <properties>
            <property name="" value=""/>
        </properties>
        <testcase assertions="" classname="" name="" status="" time="">
            <skipped/>
            <error message="" type=""/>
            <failure message="" type=""/>
            <system-out/>
            <system-err/>
        </testcase>
        <system-out/>
        <system-err/>
    </testsuite>
    <testsuite ...>
       ...
    </testsuite>
    ...
</testsuites>

Source: https://stackoverflow.com/a/9691131/7269988

@nicoddemus
Copy link
Member

I think this can now be closed given the introduction of junitxml_family option.

@danilomendesdias
Copy link

@nicoddemus record-property still add properties inside testcase which seems to be wrong (it should be inside testsuite).
Hypothesis is currently making usage of it and it is breaking junit reports on jenkins (see HypothesisWorks/hypothesis#1935).

@nicoddemus
Copy link
Member

Indeed that seems to be wrong:

https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd

@danilomendesdias would you like to contribute a PR with that fix?

@danilomendesdias
Copy link

I'll work on that @nicoddemus. Thanks for you reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: junitxml related to the junitxml builtin plugin topic: reporting related to terminal output and user-facing messages and errors type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog
Projects
None yet
Development

No branches or pull requests

8 participants