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

Unified Diff: testing/scripts/run_telemetry_benchmark_as_googletest.py

Issue 2385183002: Ignoring all results but chartjson on disabled benchmark run. (Closed)
Patch Set: Created 4 years, 2 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 a617dcbbb8145b7eefeb3960761d6685943dadf7..1da971d80092424010e0a1d03a9f9141a17b9b0a 100755
--- a/testing/scripts/run_telemetry_benchmark_as_googletest.py
+++ b/testing/scripts/run_telemetry_benchmark_as_googletest.py
@@ -71,20 +71,25 @@ def main():
'--output-dir', tempfile_dir,
'--output-format=json'
], env=env)
- tempfile_name = os.path.join(tempfile_dir, 'results.json')
- with open(tempfile_name) as f:
- results = json.load(f)
- for value in results['per_page_values']:
- 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 we have also output chartjson read it in and return it.
Ken Russell (switch to Gerrit) 2016/10/03 21:20:49 Strange indent?
# results-chart.json is the file name output by telemetry when the
# chartjson output format is included
if chartjson_results_present:
chart_tempfile_name = os.path.join(tempfile_dir, 'results-chart.json')
with open(chart_tempfile_name) as f:
chartresults = json.load(f)
+ # We need to get chartjson results first as this may be a disabled
+ # benchmark that was run
+ if (not chartjson_results_present or
+ (chartjson_results_present and chartresults.get('enabled', True))):
+ tempfile_name = os.path.join(tempfile_dir, 'results.json')
+ with open(tempfile_name) as f:
+ results = json.load(f)
+ for value in results['per_page_values']:
+ if value['type'] == 'failure':
+ failures.append(results['pages'][str(value['page_id'])]['name'])
+ valid = bool(rc == 0 or failures)
+
except Exception:
traceback.print_exc()
valid = False
« 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