Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reframe/frontend/runreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def junit_xml_report(json_report):
# XSD schema does not like the exponential format and since
# we do not want to impose a fixed width, we pass it to
# `Decimal` to format it automatically.
'time': str(decimal.Decimal(tc['time_total'])),
'time': str(decimal.Decimal(tc['time_total'] or 0)),
}
)
if tc['result'] == 'failure':
Expand Down
4 changes: 4 additions & 0 deletions unittests/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ def test_runall(make_runner, make_cases, common_exec_ctx, tmp_path):
with open(report_file, 'w') as fp:
jsonext.dump(report, fp)

# We explicitly set `time_total` to `None` in the last test case, in order
# to test the proper handling of `None`.`
report['runs'][0]['testcases'][-1]['time_total'] = None

# Validate the junit report
xml_report = runreport.junit_xml_report(report)
_validate_junit_report(xml_report)
Expand Down