Commit eb478a08 authored by Ashley Enstad's avatar Ashley Enstad Committed by Commit Bot

Only check for json-test-results output when the benchmark is enabled

If a benchmark is disabled but still run as a step, FormatDisabled is
called on the output_formatter instead of Format. In the case of
json-test-results, this means that no json will be output by the test
(since there is no empty version of json-test-results).

BUG=chromium:751346

NOTRY=true  # This script is not run on trybot/CQ, hence should be safe to notry

Change-Id: I4f19eeab40c1b6976e0f6c92cd5b7fff8ee17e2e
Reviewed-on: https://chromium-review.googlesource.com/598729Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ashley Enstad <ashleymarie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491622}
parent ff9b4cf8
...@@ -79,15 +79,14 @@ def main(): ...@@ -79,15 +79,14 @@ def main():
with open(chart_tempfile_name) as f: with open(chart_tempfile_name) as f:
chartresults = json.load(f) chartresults = json.load(f)
# test-results.json is the file name output by telemetry when the # Skip if this was a disabled benchmark that was run
# json-test-results format is included
tempfile_name = os.path.join(tempfile_dir, 'test-results.json')
with open(tempfile_name) as f:
json_test_results = json.load(f)
# Determine if this was a disabled benchmark that was run
if (not chartjson_results_present or if (not chartjson_results_present or
(chartjson_results_present and chartresults.get('enabled', True))): (chartjson_results_present and chartresults.get('enabled', True))):
# test-results.json is the file name output by telemetry when the
# json-test-results format is included
tempfile_name = os.path.join(tempfile_dir, 'test-results.json')
with open(tempfile_name) as f:
json_test_results = json.load(f)
num_failures = json_test_results['num_failures_by_type'].get('FAIL', 0) num_failures = json_test_results['num_failures_by_type'].get('FAIL', 0)
valid = bool(rc == 0 or num_failures != 0) valid = bool(rc == 0 or num_failures != 0)
......
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