Commit 1b0335db authored by ashleymarie's avatar ashleymarie Committed by Commit Bot

Outputing json test results to output.json

BUG=chromium:717394

Review-Url: https://codereview.chromium.org/2979703002
Cr-Commit-Position: refs/heads/master@{#485984}
parent 528b5d65
......@@ -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({
if not json_test_results_present:
json_test_results = {
'valid': valid,
'failures': failures
}, args.isolated_script_test_output)
}
json.dump(json_test_results, args.isolated_script_test_output)
return rc
finally:
......
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