From 1413e72314466ea32b43b6996bdfe56e3aec61a8 Mon Sep 17 00:00:00 2001 From: "bulach@chromium.org" Date: Mon, 17 Feb 2014 10:55:03 +0000 Subject: [PATCH] Android: re-add perf test summary. This was lost when we unified the perf test runner in crrev.com/217665. BUG=343900 Review URL: https://codereview.chromium.org/166433004 git-svn-id: http://src.chromium.org/svn/trunk/src/build@251650 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- android/pylib/perf/test_runner.py | 18 ++++++++++++++++++ android/test_runner.py | 2 ++ 2 files changed, 20 insertions(+) diff --git a/android/pylib/perf/test_runner.py b/android/pylib/perf/test_runner.py index 6f0d39b95..65ea2617d 100644 --- a/android/pylib/perf/test_runner.py +++ b/android/pylib/perf/test_runner.py @@ -81,6 +81,24 @@ def PrintTestOutput(test_name): return persisted_result['exit_code'] +def PrintSummary(test_names): + logging.info('*' * 80) + logging.info('Sharding summary') + total_time = 0 + for test_name in test_names: + file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) + if not os.path.exists(file_name): + logging.info('%s : No status file found', test_name) + continue + with file(file_name, 'r') as f: + result = pickle.loads(f.read()) + logging.info('%s : exit_code=%d in %d secs at %s', + result['name'], result['exit_code'], result['total_time'], + result['device']) + total_time += result['total_time'] + logging.info('Total steps time: %d secs', total_time) + + class _HeartBeatLogger(object): # How often to print the heartbeat on flush(). _PRINT_INTERVAL = 30.0 diff --git a/android/test_runner.py b/android/test_runner.py index 06156b12b..2221e45b7 100755 --- a/android/test_runner.py +++ b/android/test_runner.py @@ -649,6 +649,8 @@ def _RunPerfTests(options, args, error_func, devices): if perf_options.single_step: return perf_test_runner.PrintTestOutput('single_step') + perf_test_runner.PrintSummary(tests) + # Always return 0 on the sharding stage. Individual tests exit_code # will be returned on the print_step stage. return 0