[JVM] JUnit xml reports test duration time in milliseconds instead of seconds

998 views
Skip to first unread message

Powers Foss

unread,
May 25, 2012, 4:17:30 PM5/25/12
to cu...@googlegroups.com

Our Cucumber-JVM JUnit xml file reports time in milliseconds instead of seconds which is throwing off our Jenkins reports.  Examining the junit.xml file for one of our Cuke-JVM shows time="45261" which Jenkins interprets as 45,261 seconds.  Our existing cuke4duke tests running with JUnit output are reporting times of 45 seconds or so for the same test.  Is this a known issue?  Is there a workaround or setting for JUnit somewhere?  Basic googling is not revealing much.

Cheers,
Powers.

Aslak Hellesøy

unread,
May 26, 2012, 4:06:49 AM5/26/12
to cu...@googlegroups.com




On May 25, 2012, at 22:17, Powers Foss <power...@datalogix.com> wrote:


Our Cucumber-JVM JUnit xml file reports time in milliseconds instead of seconds which is throwing off our Jenkins reports.  Examining the junit.xml file for one of our Cuke-JVM shows time="45261" which Jenkins interprets as 45,261 seconds.  

Please create a ticket for this. Bonus points if you can confirm the time unit and format that should be used in junit.xml.

Using seconds as a unit sounds too coarse grained. Can it be a decimal like time="0.046"?

Aslak

Our existing cuke4duke tests running with JUnit output are reporting times of 45 seconds or so for the same test.  Is this a known issue?  Is there a workaround or setting for JUnit somewhere?  Basic googling is not revealing much.

Cheers,
Powers.

-- There are two rules:
 
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en

Paolo Ambrosio

unread,
May 28, 2012, 3:04:36 AM5/28/12
to cu...@googlegroups.com
On Sat, May 26, 2012 at 10:06 AM, Aslak Hellesøy
<aslak.h...@gmail.com> wrote:

> Can it be a decimal like time="0.046"?

The XMLReporter in Surefire prints it as seconds with milliseconds
granularity. This is the code from the AbstractReporter class:

private final NumberFormat numberFormat =
NumberFormat.getInstance( Locale.ENGLISH );

private static final int MS_PER_SEC = 1000;

String elapsedTimeAsString( long runTime )
{
return numberFormat.format( (double) runTime / MS_PER_SEC );
}

--
Paolo
Reply all
Reply to author
Forward
0 new messages