Red Hat Bugzilla – Bug 1291107
[RFE] populate duration in JUnit XML
Last modified: 2016-01-14 00:33:11 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):
Steps to Reproduce:
1. bkr job-results --format=junit-xml J:<id>
time="" attribute should be present on the <testcase/> element, for example:
<testcase classname="/distribution/beaker/setup" name="Build-Beaker-from-git" time="60">
According to the internets, the time="" attribute is a float number of seconds.
Have to compute each result's "duration" as the offset from the previous result, or the task start time for the first result.
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.
(In reply to Dan Callaghan from comment #4)
Beaker 22.0 has been released.