aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2018-05-18 22:20:48 -0700
committerGravatar GitHub <noreply@github.com>2018-05-18 22:20:48 -0700
commit2e3436aa7e4287c289dfd1f5040c710104981c28 (patch)
treefca26b228dcbe6a8571a1de616f6752ca59dd909
parente45165ddc8b3f5d3a8001dc007beff3fdb883f0b (diff)
parent0e0cc1700fc01f9ea3fbcd80e785b07a9621c7b8 (diff)
Merge pull request #15463 from jtattermusch/resultstore_reports
Display test suite names with dots correctly
-rw-r--r--tools/run_tests/python_utils/report_utils.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/run_tests/python_utils/report_utils.py b/tools/run_tests/python_utils/report_utils.py
index e4fddb8a7d..b2a256ce29 100644
--- a/tools/run_tests/python_utils/report_utils.py
+++ b/tools/run_tests/python_utils/report_utils.py
@@ -50,10 +50,12 @@ def new_junit_xml_tree():
def render_junit_xml_report(resultset,
report_file,
suite_package='grpc',
- suite_name='tests'):
+ suite_name='tests',
+ replace_dots=True):
"""Generate JUnit-like XML report."""
tree = new_junit_xml_tree()
- append_junit_xml_results(tree, resultset, suite_package, suite_name, '1')
+ append_junit_xml_results(tree, resultset, suite_package, suite_name, '1',
+ replace_dots)
create_xml_report_file(tree, report_file)
@@ -66,8 +68,18 @@ def create_xml_report_file(tree, report_file):
tree.write(report_file, encoding='UTF-8')
-def append_junit_xml_results(tree, resultset, suite_package, suite_name, id):
+def append_junit_xml_results(tree,
+ resultset,
+ suite_package,
+ suite_name,
+ id,
+ replace_dots=True):
"""Append a JUnit-like XML report tree with test results as a new suite."""
+ if replace_dots:
+ # ResultStore UI displays test suite names containing dots only as the component
+ # after the last dot, which results bad info being displayed in the UI.
+ # We replace dots by another character to avoid this problem.
+ suite_name = suite_name.replace('.', '_')
testsuite = ET.SubElement(
tree.getroot(),
'testsuite',