Commit 6f03356e authored by Wenbin Zhang's avatar Wenbin Zhang Committed by Commit Bot

[benchmarking] allow skipping upload when process perf results

This CL added a argument for process_perf_results to allow skipping upload
the results to perf dashboard. It is needed in the future when tester will
skip the uploading step.

Bug: chromium:1045256
Change-Id: I505dcf5625a193d030b44924f51fb51738a678a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2113804Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Wenbin Zhang <wenbinzhang@google.com>
Cr-Commit-Position: refs/heads/master@{#753158}
parent d31e7625
...@@ -289,8 +289,13 @@ def _scan_output_dir(task_output_dir): ...@@ -289,8 +289,13 @@ def _scan_output_dir(task_output_dir):
return benchmark_directory_map, benchmarks_shard_map_file return benchmark_directory_map, benchmarks_shard_map_file
def process_perf_results(output_json, configuration_name, build_properties, def process_perf_results(output_json,
task_output_dir, smoke_test_mode, output_results_dir): configuration_name,
build_properties,
task_output_dir,
smoke_test_mode,
output_results_dir,
skip_perf=False):
"""Process perf results. """Process perf results.
Consists of merging the json-test-format output, uploading the perf test Consists of merging the json-test-format output, uploading the perf test
...@@ -333,7 +338,7 @@ def process_perf_results(output_json, configuration_name, build_properties, ...@@ -333,7 +338,7 @@ def process_perf_results(output_json, configuration_name, build_properties,
benchmark_enabled_map = _handle_perf_json_test_results( benchmark_enabled_map = _handle_perf_json_test_results(
benchmark_directory_map, test_results_list) benchmark_directory_map, test_results_list)
if not smoke_test_mode: if not smoke_test_mode and not skip_perf:
try: try:
build_properties = json.loads(build_properties) build_properties = json.loads(build_properties)
if not configuration_name: if not configuration_name:
...@@ -625,6 +630,7 @@ def main(): ...@@ -625,6 +630,7 @@ def main():
parser.add_argument('--task-output-dir', help=argparse.SUPPRESS) parser.add_argument('--task-output-dir', help=argparse.SUPPRESS)
parser.add_argument('-o', '--output-json', required=True, parser.add_argument('-o', '--output-json', required=True,
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument('--skip-perf', help=argparse.SUPPRESS)
parser.add_argument('json_files', nargs='*', help=argparse.SUPPRESS) parser.add_argument('json_files', nargs='*', help=argparse.SUPPRESS)
parser.add_argument('--smoke-test-mode', action='store_true', parser.add_argument('--smoke-test-mode', action='store_true',
help='This test should be run in smoke test mode' help='This test should be run in smoke test mode'
...@@ -636,7 +642,8 @@ def main(): ...@@ -636,7 +642,8 @@ def main():
try: try:
return_code, _ = process_perf_results( return_code, _ = process_perf_results(
args.output_json, args.configuration_name, args.build_properties, args.output_json, args.configuration_name, args.build_properties,
args.task_output_dir, args.smoke_test_mode, output_results_dir) args.task_output_dir, args.smoke_test_mode, output_results_dir,
args.skip_perf)
return return_code return return_code
finally: finally:
shutil.rmtree(output_results_dir) shutil.rmtree(output_results_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment