[ 
https://issues.apache.org/jira/browse/SUREFIRE-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587016#comment-14587016
 ] 

ASF GitHub Bot commented on SUREFIRE-1144:
------------------------------------------

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

----


> Time for testsuite on commandline does not suit with the time value given in 
> the report file
> --------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1144
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1144
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.18
>            Reporter: Karl Heinz Marbaise
>            Assignee: Tibor Digana
>            Priority: Critical
>             Fix For: 2.19
>
>         Attachments: mvn.log, surefire.reports.tar.gz
>
>
> Currently i have a build where i got printed out the following:
> {noformat}
> [INFO] --- maven-surefire-plugin:2.18:test (default-test) @ supose-cli ---
> [INFO] Surefire report directory: 
> /Users/kama/ws-git/supose/supose-cli/target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.soebes.supose.cli.SuposeCLITest
> Configuring TestNG with: TestNG652Configurator
> Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.562 sec - 
> in com.soebes.supose.cli.SuposeCLITest
> Results :
> Tests run: 22, Failures: 0, Errors: 0, Skipped: 0
> [INFO]
> {noformat}
> So if i take a look into the appropriate surefire-report file 
> {{supose-cli/target/surefire-reports/TEST-com.soebes.supose.cli.SuposeCLITest.xml}}
>  i see the following in the first lines:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <testsuite name="com.soebes.supose.cli.SuposeCLITest" time="0.142" tests="22" 
> errors="0" skipped="0" failures="0">
>   <properties>
> {code}
> which shows a complete different time {{0.142}} instead of {{0.562}}.
> I have had expected to see the same time in the xml file as well as on the 
> print out on console...
> So the question is: Where does this difference come frome? Do i misundestand 
> a thing here?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to