Skip to content

Commit

Permalink
Add time attribute into the testsuite element of the Xunit output file
Browse files Browse the repository at this point in the history
Fixes #2979.
  • Loading branch information
kanchi240 authored and pekkaklarck committed Oct 16, 2018
1 parent f6cff4d commit b1e0dd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions atest/robot/output/xunit.robot
Expand Up @@ -36,6 +36,9 @@ Multiline failure
Should Be Equal ${failures[-1].attrib['message']} Just ASCII here\n\nAlso teardown failed:\n${MESSAGES}

Execution times are floats
${suite} = Get XUnit Node
Should match ${suite.attrib['time']} ?.???
Should be true ${suite.attrib['time']} > 0
${test} = Get XUnit Node testcase[1]
Should match ${test.attrib['time']} ?.???
Should be true ${test.attrib['time']} > 0
Expand Down
3 changes: 2 additions & 1 deletion src/robot/reporting/xunitwriter.py
Expand Up @@ -51,7 +51,8 @@ def start_suite(self, suite):
'tests': tests,
'errors': '0',
'failures': failures,
'skipped': skipped}
'skipped': skipped,
'time': self._time_as_seconds(suite.elapsedtime)}
self._writer.start('testsuite', attrs)

def _get_stats(self, statistics):
Expand Down

0 comments on commit b1e0dd0

Please sign in to comment.