GitHub user lamyaa opened a pull request:

    https://github.com/apache/maven-surefire/pull/96

    Adding individual rerun times to XML reports

    When a test fails and is rerun (with rerunFailingTestsCount > 0), the XML 
report only shows the time elapsed for the first run of the test method.
    
    For example, I ran a test suite that has one failing test with `mvn test 
-Dsurefire.rerunFailingTestsCount=1`. The console output shows the time elapsed 
for each test method (re)run:
    
    ```
    Tests run: 19, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.807 sec 
<<< FAILURE! - in org.apache.http.pool.TestConnPool
    
testStatefulConnectionRedistributionOnPerRouteMaxLimit(org.apache.http.pool.TestConnPool)
  Time elapsed: 0.016 sec  <<< FAILURE!
    junit.framework.AssertionFailedError: null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
    
    
testStatefulConnectionRedistributionOnPerRouteMaxLimit(org.apache.http.pool.TestConnPool)
  Time elapsed: 0.007 sec  <<< FAILURE!
    junit.framework.AssertionFailedError: null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
    ```
    
    However, the XML report only shows the time elapsed for the first method 
run:
    
    ```xml
      <testcase name="testStatefulConnectionRedistributionOnPerRouteMaxLimit" 
classname="org.apache.http.pool.TestConnPool" time="0.016">
        <failure 
type="junit.framework.AssertionFailedError:">junit.framework.AssertionFailedError:
 null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
        </failure>
        <rerunFailure 
type="junit.framework.AssertionFailedError:">junit.framework.AssertionFailedError:
 null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
        </rerunFailure>
      </testcase>
    ```
    
    This pull request extends the XML reports to also show the individual times 
of each rerun as well as the total time for the original run + the reruns. With 
this change, the XML report looks as follows:
    
    ```xml
      <testcase name="testStatefulConnectionRedistributionOnPerRouteMaxLimit" 
classname="org.apache.http.pool.TestConnPool" time="0.025">
        <failure type="junit.framework.AssertionFailedError:" 
time="0.017">junit.framework.AssertionFailedError: null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
        </failure>
        <rerunFailure type="junit.framework.AssertionFailedError:" 
time="0.008">junit.framework.AssertionFailedError: null
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.fail(Assert.java:53)
            at 
org.apache.http.pool.TestConnPool.testStatefulConnectionRedistributionOnPerRouteMaxLimit(TestConnPool.java:484)
        </rerunFailure>
      </testcase>
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lamyaa/maven-surefire rerun_time_xml

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-surefire/pull/96.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #96
    
----
commit a138d0aa6758a23760de12e4a23c1416c3303d02
Author: lamyaa <[email protected]>
Date:   2015-05-08T17:19:42Z

    Adding individual rerun times and total times to xml reports

commit d74d57e73c842ac697eab739aa8bf66418631e6a
Author: Lamyaa Eloussi <[email protected]>
Date:   2015-06-04T22:34:42Z

    Synching with original repository

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to