GitHub user lamyaa opened a pull request:
https://github.com/apache/maven-surefire/pull/98
[Surefire-1144] Time for testsuite on commandline does not suit with the
time value given in the report file
https://issues.apache.org/jira/browse/SUREFIRE-1144
This pull request modifies the XML reporter such that it shows time
computed as `endTime - startTime` rather than summing up the method execution
times through `getRunTimeForAllTests()`.
I have tested this patch with the project provided by Karl in the bug
report thread:
https://github.com/khmarbaise/supose/
The time shown in the XML report is now consistent with the one shown in
the console.
@Tibor17 I would appreciate your input on a couple of things:
1) Initially, I deleted line 111/122 (`elapsedForTestSet +=
elapsedForThis;`) in TestSetStats and line 100 (` elapsedForTestSet =
testSetEndAt - testSetStartAt;)` was not within an if-block. However, that made
XmlReporterRunTimeIT fail. The IT runs test methods in parallel and
`testSetEndAt - testSetStartAt` ends up being abnormally small, smaller than
the sleep times of any of the test methods. I don't understand enough of how
the parallelism and fork code is implemented to properly debug that so I left
line 111/122 and wrapped line 100 within an if-block. Please let me know if you
have a better idea of how to deal with this.
2) The XML report now prints `elapsedForTestSet = testSetEndAt -
testSetStartAt` but the console (which I have not changed) prints
`elapsedSinceTestSetStart = currentTime - testSetStartAt`. This means the
console time may be 1 or 2ms more than the XML report time. Do you think it
would be good to have the console also print `elapsedForTestSet`? If not, I
probably need to change Surefire1144XmlRunTimeIT to accept a 1 or 2ms
difference.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lamyaa/maven-surefire surefire-1144
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/maven-surefire/pull/98.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 #98
----
commit 9d4931b9ccd82e9305efe1405a56083b6023e84e
Author: lamyaa <[email protected]>
Date: 2015-06-12T19:29:58Z
[Surefire-1144] Time for testsuite on commandline does not suit with the
time value given in the report file
----
---
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]