Bug 1291107 - [RFE] populate duration in JUnit XML
Summary: [RFE] populate duration in JUnit XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: develop
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 22.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-14 00:57 UTC by Dan Callaghan
Modified: 2016-01-14 05:33 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-14 05:33:11 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2015-12-14 00:57:40 UTC
Description of problem:
Duration is not populated in the JUnit XML output, as a result Jenkins displays every test as 0ms duration. Beaker has duration info so we should include it.

Version-Release number of selected component (if applicable):
develop

Steps to Reproduce:
1. bkr job-results --format=junit-xml J:<id>

Expected results:
time="" attribute should be present on the <testcase/> element, for example:

<testcase classname="/distribution/beaker/setup" name="Build-Beaker-from-git" time="60">
...

Additional info:
According to the internets, the time="" attribute is a float number of seconds.

Comment 1 Dan Callaghan 2015-12-14 07:02:46 UTC
Have to compute each result's "duration" as the offset from the previous result, or the task start time for the first result.

Comment 2 Dan Callaghan 2015-12-14 07:47:00 UTC
http://gerrit.beaker-project.org/4538

Comment 4 Dan Callaghan 2015-12-21 03:34:50 UTC
Just noticed that we need to *not* set the duration for the result representing the overall task. Jenkins shows the duration of each test "class" as the sum of the duration of each test "method" in the class, which means the duration appears doubled because we are reporting the duration for each result plus the overall task as well.

Comment 5 Dan Callaghan 2015-12-22 04:11:19 UTC
(In reply to Dan Callaghan from comment #4)

http://gerrit.beaker-project.org/4557

Comment 8 Dan Callaghan 2016-01-14 05:33:11 UTC
Beaker 22.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.