Bug 1291107 - [RFE] populate duration in JUnit XML
[RFE] populate duration in JUnit XML
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: general (Show other bugs)
develop
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 22.0
: ---
Assigned To: Dan Callaghan
tools-bugs
: FutureFeature, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-13 19:57 EST by Dan Callaghan
Modified: 2016-01-14 00:33 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-14 00:33:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2015-12-13 19:57:40 EST
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 02:02:46 EST
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 02:47:00 EST
http://gerrit.beaker-project.org/4538
Comment 4 Dan Callaghan 2015-12-20 22:34:50 EST
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-21 23:11:19 EST
(In reply to Dan Callaghan from comment #4)

http://gerrit.beaker-project.org/4557
Comment 8 Dan Callaghan 2016-01-14 00:33:11 EST
Beaker 22.0 has been released.

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