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

Side by Side Diff: gm/rebaseline_server/results.py

Issue 99763007: Tiny, urgent fix for rebaseline_server to accept new baselines. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years 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 | « no previous file | 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 """ 3 """
4 Copyright 2013 Google Inc. 4 Copyright 2013 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. 9 Repackage expected/actual GM results as needed by our HTML rebaseline viewer.
10 """ 10 """
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 for dirpath, dirnames, filenames in os.walk(root): 231 for dirpath, dirnames, filenames in os.walk(root):
232 for matching_filename in fnmatch.filter(filenames, pattern): 232 for matching_filename in fnmatch.filter(filenames, pattern):
233 builder = os.path.basename(dirpath) 233 builder = os.path.basename(dirpath)
234 # We should never encounter Trybot *expectations*, but if we are 234 # We should never encounter Trybot *expectations*, but if we are
235 # writing into the actual-results dir, skip the Trybot actuals. 235 # writing into the actual-results dir, skip the Trybot actuals.
236 # (I don't know why we would ever write into the actual-results dir, 236 # (I don't know why we would ever write into the actual-results dir,
237 # though.) 237 # though.)
238 if builder.endswith('-Trybot'): 238 if builder.endswith('-Trybot'):
239 continue 239 continue
240 per_builder_dict = meta_dict.get(builder) 240 per_builder_dict = meta_dict.get(builder)
241 if per_builder_dict: 241 if per_builder_dict is not None:
242 fullpath = os.path.join(dirpath, matching_filename) 242 fullpath = os.path.join(dirpath, matching_filename)
243 gm_json.WriteToFile(per_builder_dict, fullpath) 243 gm_json.WriteToFile(per_builder_dict, fullpath)
244 actual_builders_written.append(builder) 244 actual_builders_written.append(builder)
245 245
246 # Check: did we write out the set of per-builder dictionaries we 246 # Check: did we write out the set of per-builder dictionaries we
247 # expected to? 247 # expected to?
248 expected_builders_written = sorted(meta_dict.keys()) 248 expected_builders_written = sorted(meta_dict.keys())
249 actual_builders_written.sort() 249 actual_builders_written.sort()
250 if expected_builders_written != actual_builders_written: 250 if expected_builders_written != actual_builders_written:
251 raise KeyError( 251 raise KeyError(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 category_dict: category dict-of-dicts to modify 476 category_dict: category dict-of-dicts to modify
477 category_name: category name, as a string 477 category_name: category name, as a string
478 category_values: list of values we want to make sure are represented 478 category_values: list of values we want to make sure are represented
479 for this category 479 for this category
480 """ 480 """
481 if not category_dict.get(category_name): 481 if not category_dict.get(category_name):
482 category_dict[category_name] = {} 482 category_dict[category_name] = {}
483 for category_value in category_values: 483 for category_value in category_values:
484 if not category_dict[category_name].get(category_value): 484 if not category_dict[category_name].get(category_value):
485 category_dict[category_name][category_value] = 0 485 category_dict[category_name][category_value] = 0
OLDNEW
« 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