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

Side by Side Diff: log_parser/perf_expectations/tests/perf_expectations_unittest.py

Issue 231017: Expectations for 3 perf systems on morejs and startup.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/buildbot/scripts/master/
Patch Set: Created 11 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 unified diff | Download patch
« no previous file with comments | « log_parser/perf_expectations/perf_expectations.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Verify perf_expectations.json can be loaded using simplejson. 7 """Verify perf_expectations.json can be loaded using simplejson.
8 8
9 perf_expectations.json is a JSON-formatted file. This script verifies 9 perf_expectations.json is a JSON-formatted file. This script verifies
10 that simplejson can load it correctly. It should catch most common 10 that simplejson can load it correctly. It should catch most common
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 not isinstance(perf_data[key]['var'], float)): 114 not isinstance(perf_data[key]['var'], float)):
115 bad_keys.append(key) 115 bad_keys.append(key)
116 if len(bad_keys) > 0: 116 if len(bad_keys) > 0:
117 msg = "perf expectations key values missing or invalid delta/var" 117 msg = "perf expectations key values missing or invalid delta/var"
118 raise Exception("%s: %s" % (msg, bad_keys)) 118 raise Exception("%s: %s" % (msg, bad_keys))
119 119
120 # Test all keys have the correct format. 120 # Test all keys have the correct format.
121 for key in perf_data: 121 for key in perf_data:
122 if key == 'load': 122 if key == 'load':
123 continue 123 continue
124 # tools/buildbot/scripts/master/log_parser.py should have a matching
125 # regular expression.
124 if not re.match(r"^([\w\.-]+)/([\w\.-]+)/([\w\.-]+)/([\w\.-]+)$", key): 126 if not re.match(r"^([\w\.-]+)/([\w\.-]+)/([\w\.-]+)/([\w\.-]+)$", key):
125 bad_keys.append(key) 127 bad_keys.append(key)
126 if len(bad_keys) > 0: 128 if len(bad_keys) > 0:
127 msg = "perf expectations keys in bad format, expected a/b/c/d" 129 msg = "perf expectations keys in bad format, expected a/b/c/d"
128 raise Exception("%s: %s" % (msg, bad_keys)) 130 raise Exception("%s: %s" % (msg, bad_keys))
129 131
130 if __name__ == '__main__': 132 if __name__ == '__main__':
131 unittest.main() 133 unittest.main()
OLDNEW
« no previous file with comments | « log_parser/perf_expectations/perf_expectations.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698