Commit eaf80825 authored by Ethan Kuefner's avatar Ethan Kuefner Committed by Commit Bot

Pick up histogram output file if we're outputting histograms

HistogramSet has a different default output filename when using Telemetry; we
need to account for this in run_telemetry_benchmark_as_googletest so that that
script can find the histogram output if present.

Bug: 744736
Change-Id: I1fec4a2d86e7e0a9700bc0b44160b78f0484d866
Reviewed-on: https://chromium-review.googlesource.com/683780Reviewed-by: default avatarStephen Martinis <martiniss@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#504486}
parent eaebb092
...@@ -54,9 +54,9 @@ def main(): ...@@ -54,9 +54,9 @@ def main():
for output_format in args.output_format: for output_format in args.output_format:
rest_args.append('--output-format=' + output_format) rest_args.append('--output-format=' + output_format)
rc, chartresults, json_test_results = run_benchmark(args, rest_args) rc, perf_results, json_test_results = run_benchmark(args, rest_args)
if chartresults: if perf_results:
if args.isolated_script_test_perf_output: if args.isolated_script_test_perf_output:
filename = args.isolated_script_test_perf_output filename = args.isolated_script_test_perf_output
elif args.isolated_script_test_chartjson_output: elif args.isolated_script_test_chartjson_output:
...@@ -65,8 +65,8 @@ def main(): ...@@ -65,8 +65,8 @@ def main():
filename = None filename = None
if filename is not None: if filename is not None:
with open(filename, 'w') as chartjson_output_file: with open(filename, 'w') as perf_results_output_file:
json.dump(chartresults, chartjson_output_file) json.dump(perf_results, perf_results_output_file)
json.dump(json_test_results, args.isolated_script_test_output) json.dump(json_test_results, args.isolated_script_test_output)
...@@ -81,8 +81,9 @@ def run_benchmark(args, rest_args): ...@@ -81,8 +81,9 @@ def run_benchmark(args, rest_args):
tempfile_dir = tempfile.mkdtemp('telemetry') tempfile_dir = tempfile.mkdtemp('telemetry')
valid = True valid = True
num_failures = 0 num_failures = 0
histogram_results_present = 'histograms' in args.output_format
chartjson_results_present = 'chartjson' in args.output_format chartjson_results_present = 'chartjson' in args.output_format
chartresults = None perf_results = None
json_test_results = None json_test_results = None
results = None results = None
...@@ -99,10 +100,16 @@ def run_benchmark(args, rest_args): ...@@ -99,10 +100,16 @@ def run_benchmark(args, rest_args):
# If we have also output chartjson read it in and return it. # If we have also output chartjson read it in and return it.
# results-chart.json is the file name output by telemetry when the # results-chart.json is the file name output by telemetry when the
# chartjson output format is included # chartjson output format is included
if chartjson_results_present: if histogram_results_present:
chart_tempfile_name = os.path.join(tempfile_dir, 'results-chart.json') tempfile_name = os.path.join(tempfile_dir, 'histograms.json')
with open(chart_tempfile_name) as f: elif chartjson_results_present:
chartresults = json.load(f) tempfile_name = os.path.join(tempfile_dir, 'results-chart.json')
else:
tempfile_name = None
if tempfile_name is not None:
with open(tempfile_name) as f:
perf_results = json.load(f)
# test-results.json is the file name output by telemetry when the # test-results.json is the file name output by telemetry when the
# json-test-results format is included # json-test-results format is included
...@@ -125,7 +132,7 @@ def run_benchmark(args, rest_args): ...@@ -125,7 +132,7 @@ def run_benchmark(args, rest_args):
if rc == 0: if rc == 0:
rc = 1 # Signal an abnormal exit. rc = 1 # Signal an abnormal exit.
return rc, chartresults, json_test_results return rc, perf_results, json_test_results
# This is not really a "script test" so does not need to manually add # This is not really a "script test" so does not need to manually add
......
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