Chromium Code Reviews| Index: testing/scripts/run_telemetry_benchmark_as_googletest.py |
| diff --git a/testing/scripts/run_telemetry_benchmark_as_googletest.py b/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| index 387c5c8da95993f984f20522253b471eca93a58d..fe7bcd06d5c41adc5be2870c9e14feaa521d3c03 100755 |
| --- a/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| +++ b/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| @@ -62,6 +62,10 @@ def main(): |
| tempfile_dir = tempfile.mkdtemp('telemetry') |
| valid = True |
| failures = [] |
| + chartjson = False |
| + if '--output-format=chartjson' in rest_args: |
| + chartjson = True |
| + chartresults = None |
| try: |
| rc = common.run_command([sys.executable] + rest_args + [ |
| '--output-dir', tempfile_dir, |
| @@ -74,6 +78,11 @@ def main(): |
| if value['type'] == 'failure': |
| failures.append(results['pages'][str(value['page_id'])]['name']) |
| valid = bool(rc == 0 or failures) |
| + # If we have also output chartjson read it in and return it |
| + if chartjson: |
| + chart_tempfile_name = os.path.join(tempfile_dir, 'results-chart.json') |
| + with open(chart_tempfile_name) as f: |
| + chartresults = json.load(f) |
| except Exception: |
| traceback.print_exc() |
| valid = False |
| @@ -85,10 +94,17 @@ def main(): |
| if rc == 0: |
| rc = 1 # Signal an abnormal exit. |
| - json.dump({ |
| - 'valid': valid, |
| - 'failures': failures, |
| - }, args.isolated_script_test_output) |
| + if chartjson: |
| + json.dump({ |
| + 'valid': valid, |
| + 'failures': failures, |
| + 'chartjson': chartresults |
| + }, args.isolated_script_test_output) |
| + else: |
| + json.dump({ |
| + 'valid': valid, |
| + 'failures': failures |
| + }, args.isolated_script_test_output) |
|
Ken Russell (switch to Gerrit)
2016/09/12 19:31:42
Rather than overloading the meaning of --isolated-
eyaich1
2016/09/13 11:53:41
Good to know there is another use case coming down
|
| return rc |
| finally: |