diff options
author | 2017-05-04 14:06:53 +0200 | |
---|---|---|
committer | 2017-05-04 14:55:16 +0200 | |
commit | 883fe50140a44927853ebffcbe5747dcc2c348e3 (patch) | |
tree | 50caeb27fa47c696e851275d5c53949e8b53c733 /tools/run_tests/python_utils | |
parent | 98e8d59ece3cd24cec29c2d6b4928bf0409c13e3 (diff) |
add error and failure count to sponge log
Diffstat (limited to 'tools/run_tests/python_utils')
-rw-r--r-- | tools/run_tests/python_utils/report_utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/run_tests/python_utils/report_utils.py b/tools/run_tests/python_utils/report_utils.py index c7c0ceea92..002f49960a 100644 --- a/tools/run_tests/python_utils/report_utils.py +++ b/tools/run_tests/python_utils/report_utils.py @@ -64,6 +64,8 @@ def render_junit_xml_report(resultset, xml_report, suite_package='grpc', root = ET.Element('testsuites') testsuite = ET.SubElement(root, 'testsuite', id='1', package=suite_package, name=suite_name) + failure_count = 0 + error_count = 0 for shortname, results in six.iteritems(resultset): for result in results: xml_test = ET.SubElement(testsuite, 'testcase', name=shortname) @@ -73,10 +75,14 @@ def render_junit_xml_report(resultset, xml_report, suite_package='grpc', 'XML') if result.state == 'FAILED': ET.SubElement(xml_test, 'failure', message='Failure') + failure_count += 1 elif result.state == 'TIMEOUT': ET.SubElement(xml_test, 'error', message='Timeout') + error_count += 1 elif result.state == 'SKIPPED': ET.SubElement(xml_test, 'skipped', message='Skipped') + testsuite.set('failures', str(failure_count)) + testsuite.set('errors', str(error_count)) # ensure the report directory exists report_dir = os.path.dirname(os.path.abspath(xml_report)) if not os.path.exists(report_dir): |