summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2019-12-06 13:21:24 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2019-12-06 16:06:47 (GMT)
commitafe09ee7b35a13602dc5e7778f0ff0c74334b444 (patch)
tree349825936fc1bdc75191a534bcf4f104d54e998a
parent211262eb78eaa8badb780e05e612a2516e7bfb7c (diff)
downloadauthentic-master.zip
authentic-master.tar.gz
authentic-master.tar.bz2
jenkins: don't assume presence of optional data in test results (#38266)HEADmaster
-rwxr-xr-xmerge-junit-results.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/merge-junit-results.py b/merge-junit-results.py
index a50bc7f..6f1eec5 100755
--- a/merge-junit-results.py
+++ b/merge-junit-results.py
@@ -36,10 +36,10 @@ def merge_results(xml_files):
for file_name in xml_files:
tree = ET.parse(file_name)
test_suite = tree.getroot()
- failures += int(test_suite.attrib['failures'])
- tests += int(test_suite.attrib['tests'])
- errors += int(test_suite.attrib['errors'])
- time += float(test_suite.attrib['time'])
+ failures += int(test_suite.attrib.get('failures', '0'))
+ tests += int(test_suite.attrib.get('tests', '0'))
+ errors += int(test_suite.attrib.get('errors', '0'))
+ time += float(test_suite.attrib.get('time', '0.'))
name = test_suite.attrib.get('name', '')
for child in test_suite.getchildren():
child.attrib['classname'] = '%s-%s' % (name, child.attrib.get('classname', ''))