Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: testing/scripts/run_telemetry_benchmark_as_googletest.py

Issue 2979703002: Outputing json test results to output.json (Closed)
Patch Set: simplifying logic in run_telemetry_benchmark_as_googletest Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a1343b37190abdd2a1e70a24f6296971f1d60614 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({
- 'valid': valid,
- 'failures': failures
- }, args.isolated_script_test_output)
+ if not json_test_results_present:
+ json_test_results = {
+ 'valid': valid,
+ 'failures': failures
+ }
+
+ json.dump(json_test_results, args.isolated_script_test_output)
return rc
finally:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698