Bug 1291107

Summary: [RFE] populate duration in JUnit XML
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: dcallagh, dowang, mjia, rjoost
Target Milestone: 22.0Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-14 05:33:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.