From dc3a4c47d2c3557a5862d9040f5c95d9c523ac9f Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Fri, 19 Nov 2021 10:42:03 +0100 Subject: [PATCH] Dump json output for webrtc tests using gtest_parallel. This is required step in order to upload tests results to ResultDB. Bug: b/197492097 Change-Id: Ifff898997f6c9a3385659be34e7545217bb08f88 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238000 Commit-Queue: Jeremy Leconte Reviewed-by: Christoffer Jansson Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#35385} --- tools_webrtc/mb/mb.py | 2 ++ tools_webrtc/mb/mb_unittest.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tools_webrtc/mb/mb.py b/tools_webrtc/mb/mb.py index e8d2d63245..bed28e3b92 100755 --- a/tools_webrtc/mb/mb.py +++ b/tools_webrtc/mb/mb.py @@ -947,10 +947,12 @@ class MetaBuildWrapper(object): ] sep = '\\' if self.platform == 'win32' else '/' output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs' + test_results = '${ISOLATED_OUTDIR}' + sep + 'gtest_output.json' timeout = isolate_map[target].get('timeout', 900) cmdline += [ '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=%s' % output_dir, + '--dump_json_test_results=%s' % test_results, '--gtest_color=no', # We tell gtest-parallel to interrupt the test after 900 # seconds, so it can exit cleanly and report results, diff --git a/tools_webrtc/mb/mb_unittest.py b/tools_webrtc/mb/mb_unittest.py index fc359d9995..2f0a61913d 100755 --- a/tools_webrtc/mb/mb_unittest.py +++ b/tools_webrtc/mb/mb_unittest.py @@ -411,6 +411,7 @@ class UnitTest(unittest.TestCase): '../../testing/test_env.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}/test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json', '--gtest_color=no', '--timeout=500', '--workers=1', @@ -533,6 +534,7 @@ class UnitTest(unittest.TestCase): '../../testing/test_env.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}/test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json', '--gtest_color=no', '--timeout=900', '--workers=1', @@ -583,6 +585,7 @@ class UnitTest(unittest.TestCase): '../../testing/xvfb.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}/test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json', '--gtest_color=no', '--timeout=900', '--retry_failed=3', @@ -634,6 +637,7 @@ class UnitTest(unittest.TestCase): '../../testing/test_env.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}\\test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}\\gtest_output.json', '--gtest_color=no', '--timeout=900', '--retry_failed=3', @@ -680,6 +684,7 @@ class UnitTest(unittest.TestCase): '../../testing/test_env.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}/test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json', '--gtest_color=no', '--timeout=900', '--retry_failed=3', @@ -731,6 +736,7 @@ class UnitTest(unittest.TestCase): '../../testing/test_env.py', '../../tools_webrtc/gtest-parallel-wrapper.py', '--output_dir=${ISOLATED_OUTDIR}/test_logs', + '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json', '--gtest_color=no', '--timeout=900', '--retry_failed=3',