diff options
Diffstat (limited to 'tools/run_tests/python_utils')
-rwxr-xr-x | tools/run_tests/python_utils/jobset.py | 4 | ||||
-rw-r--r-- | tools/run_tests/python_utils/report_utils.py | 18 | ||||
-rw-r--r-- | tools/run_tests/python_utils/upload_rbe_results.py | 12 |
3 files changed, 29 insertions, 5 deletions
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index 6a3391337e..561f453da7 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -31,7 +31,9 @@ import errno measure_cpu_costs = False _DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count() -_MAX_RESULT_SIZE = 8192 +# Maximum number of bytes of job's stdout that will be stored in the result. +# Only last N bytes of stdout will be kept if the actual output longer. +_MAX_RESULT_SIZE = 64 * 1024 # NOTE: If you change this, please make sure to test reviewing the 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', diff --git a/tools/run_tests/python_utils/upload_rbe_results.py b/tools/run_tests/python_utils/upload_rbe_results.py index d302024883..5955b3792f 100644 --- a/tools/run_tests/python_utils/upload_rbe_results.py +++ b/tools/run_tests/python_utils/upload_rbe_results.py @@ -146,7 +146,15 @@ if __name__ == "__main__": test_cases = [{ 'testCase': { 'caseName': str(action['id']['actionId']), - 'result': str(action['statusAttributes']['status']) + } + }] + # Test timeouts have a different dictionary structure compared to pass and + # fail results. + elif action['statusAttributes']['status'] == 'TIMED_OUT': + test_cases = [{ + 'testCase': { + 'caseName': str(action['id']['actionId']), + 'timedOut': True } }] else: @@ -155,6 +163,8 @@ if __name__ == "__main__": for test_case in test_cases: if 'errors' in test_case['testCase']: result = 'FAILED' + elif 'timedOut' in test_case['testCase']: + result = 'TIMEOUT' else: result = 'PASSED' bq_rows.append({ |