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

Unified Diff: testing/scripts/run_telemetry_benchmark_as_googletest.py

Issue 2793913003: Fix bug in telemetry benchmark script (Closed)
Patch Set: Created 3 years, 9 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 1da971d80092424010e0a1d03a9f9141a17b9b0a..cadb30bdad80ebb1895e4e1a75ffd1476137f8cc 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
+
+ results = None
try:
rc = common.run_command([sys.executable] + rest_args + [
'--output-dir', tempfile_dir,
@@ -87,11 +89,19 @@ def main():
results = json.load(f)
for value in results['per_page_values']:
if value['type'] == 'failure':
- failures.append(results['pages'][str(value['page_id'])]['name'])
+ page_data = results['pages'][str(value['page_id'])]
+ name = page_data.get('name')
+ if not name:
+ name = page_data['url']
+
+ failures.append(name)
valid = bool(rc == 0 or failures)
except Exception:
traceback.print_exc()
+ if results:
+ print 'results, which possibly caused exception: %s' % json.dumps(
+ results, indent=2)
valid = False
finally:
shutil.rmtree(tempfile_dir)
« 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