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 cadb30bdad80ebb1895e4e1a75ffd1476137f8cc..5b4d04bc6b40d4d3f58d50b13d6460d22619f453 100755 |
| --- a/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| +++ b/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| @@ -66,6 +66,8 @@ def main(): |
| failures = [] |
| chartjson_results_present = '--output-format=chartjson' in rest_args |
| chartresults = None |
| + json_test_results_present = '--output-format=json-test-results' in rest_args |
| + json_test_results = None |
| results = None |
| try: |
| @@ -97,6 +99,11 @@ def main(): |
| failures.append(name) |
| valid = bool(rc == 0 or failures) |
| + if json_test_results_present: |
| + tempfile_name = os.path.join(tempfile_dir, 'test-results.json') |
| + with open(tempfile_name) as f: |
| + json_test_results = json.load(f) |
| + |
| except Exception: |
| traceback.print_exc() |
| if results: |
| @@ -116,10 +123,13 @@ def main(): |
| open(args.isolated_script_test_chartjson_output, 'w') |
| json.dump(chartresults, chartjson_output_file) |
| - json.dump({ |
| + json_results = { |
| 'valid': valid, |
| 'failures': failures |
| - }, args.isolated_script_test_output) |
| + } |
| + if json_test_results_present: |
| + json_results = json_test_results |
|
perezju
2017/07/12 08:07:58
nit: maybe this could just be:
if not json_test_r
ashleymarie1
2017/07/12 14:04:38
Done.
|
| + json.dump(json_results, args.isolated_script_test_output) |
|
perezju
2017/07/12 08:07:58
Higher level question. Do clients (e.g. build bot)
|
| return rc |
| finally: |