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

Unified Diff: tools/perf_expectations/tests/perf_expectations_unittest.py

Issue 3115012: Update linux/moz to use new perf format. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: add presubmit updates Created 10 years, 4 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 | « tools/perf_expectations/perf_expectations.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf_expectations/tests/perf_expectations_unittest.py
diff --git a/tools/perf_expectations/tests/perf_expectations_unittest.py b/tools/perf_expectations/tests/perf_expectations_unittest.py
index 88b8251209458d71083d971f5f87fa33d0990469..ffb0e2314e217443f9237a05e7a8fc71525004fb 100755
--- a/tools/perf_expectations/tests/perf_expectations_unittest.py
+++ b/tools/perf_expectations/tests/perf_expectations_unittest.py
@@ -105,14 +105,28 @@ class PerfExpectationsUnittest(unittest.TestCase):
for key in perf_data:
if key == 'load':
continue
- if 'delta' not in perf_data[key] or 'var' not in perf_data[key]:
- bad_keys.append(key)
- if (not isinstance(perf_data[key]['delta'], int) and
- not isinstance(perf_data[key]['delta'], float)):
- bad_keys.append(key)
- if (not isinstance(perf_data[key]['var'], int) and
- not isinstance(perf_data[key]['var'], float)):
- bad_keys.append(key)
+
+ # First check if regress/improve is in the key's data.
+ if 'regress' in perf_data[key]:
+ if 'improve' not in perf_data[key]:
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['regress'], int) and
+ not isinstance(perf_data[key]['regress'], float)):
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['improve'], int) and
+ not isinstance(perf_data[key]['improve'], float)):
+ bad_keys.append(key)
+ else:
+ # Otherwise check if delta/var is in the key's data.
+ if 'delta' not in perf_data[key] or 'var' not in perf_data[key]:
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['delta'], int) and
+ not isinstance(perf_data[key]['delta'], float)):
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['var'], int) and
+ not isinstance(perf_data[key]['var'], float)):
+ bad_keys.append(key)
+
if len(bad_keys) > 0:
msg = "perf expectations key values missing or invalid delta/var"
raise Exception("%s: %s" % (msg, bad_keys))
« no previous file with comments | « tools/perf_expectations/perf_expectations.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698