Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31187

Not all failure cases reported in JUnit test result report

    XMLWordPrintable

Details

    Description

      Hi,
      JUnit allows to collect multiple test failures, eg. using ErrorCollector rule. But JUnit Plugin reports only first failure.

      For example test result may looks like this:

      ...
      <testcase classname="com.SomeTestClass" name="someTestName" time="7.718">
        <failure message="Some error 1 message" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: Some error 1 message
          at Some failure 1 stack trace...
        </failure>
        <failure message="Some error 2 message" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: Some error 2 message
          at Some failure 2 stack trace...
        </failure>
      </testcase>
      ...
      

      From above snippet only "Some error 1 message" will be reported, junitResults.xml:

      ...
      <case>
        <duration>7.718</duration>
        <className>com.SomeTestClass</className>
        <testName>someTestName</testName>
        <skipped>false</skipped>
        <errorStackTrace>junit.framework.AssertionFailedError: Some error 1 message
          at Some failure 1 stack trace...
        </errorStackTrace>
        <errorDetails>Some error 1 message</errorDetails>
        <failedSince>0</failedSince>
      </case>
      ..
      

      Is it possible for JUnit Plugin to report all failures?

      Attachments

        Activity

          People

            Unassigned Unassigned
            abeben Adam Beben
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: