Skip to content

xunitparser does not handle multiple <failure> or <error> per <testcase> #8

@dnozay

Description

@dnozay

e.g. parsing these will fail:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="myexample" timestamp="2015-06-24T11:31:08" time="0.01" errors="0" tests="1" skipped="0" failures="2">
  <testcase classname="myexample" name="mytest" time="0.005">
    <failure type="toBe" message="failed expectation #1"></failure>
    <failure type="toBe" message="failed expectation #2"></failure>
  </testcase>
</testsuite>
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="myexample" timestamp="2015-06-24T11:31:08" time="0.01" errors="2" tests="1" skipped="0" failures="0">
  <testcase classname="myexample" name="mytest" time="0.005">
    <error type="systemerror" message="system error #1"></error>
    <error type="systemerror" message="system error #2"></error>
  </testcase>
</testsuite>
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="myexample" timestamp="2015-06-24T11:31:08" time="0.01" errors="1" tests="1" skipped="0" failures="1">
  <testcase classname="myexample" name="mytest" time="0.005">
    <error type="systemerror" message="system error #1"></error>
    <failure type="failure" message="could not make system call due to system error #1"></failure>
  </testcase>
</testsuite>

however based on the schema defined for jUnit format, they are valid.

see also larrymyers/jasmine-reporters#102

see also https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd

            <xs:sequence>
                <xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions