Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 ''' | 3 ''' |
| 4 Copyright 2012 Google Inc. | 4 Copyright 2012 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 | 9 |
| 10 ''' | 10 ''' |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 sections = [gm_json.JSONKEY_ACTUALRESULTS_FAILED] | 191 sections = [gm_json.JSONKEY_ACTUALRESULTS_FAILED] |
| 192 if add_new: | 192 if add_new: |
| 193 sections.append(gm_json.JSONKEY_ACTUALRESULTS_NOCOMPARISON) | 193 sections.append(gm_json.JSONKEY_ACTUALRESULTS_NOCOMPARISON) |
| 194 | 194 |
| 195 files_to_rebaseline = [] | 195 files_to_rebaseline = [] |
| 196 for section in sections: | 196 for section in sections: |
| 197 section_results = actual_results[section] | 197 section_results = actual_results[section] |
| 198 if section_results: | 198 if section_results: |
| 199 files_to_rebaseline.extend(section_results.keys()) | 199 files_to_rebaseline.extend(section_results.keys()) |
| 200 | 200 |
| 201 files_to_rebaseline.sort() | |
|
epoger
2013/06/12 15:32:36
Patchset 2 sorts the files we will rebaseline, jus
| |
| 201 print '# ... found files_to_rebaseline %s' % files_to_rebaseline | 202 print '# ... found files_to_rebaseline %s' % files_to_rebaseline |
| 202 if self._dry_run: | 203 if self._dry_run: |
| 203 print '#' | 204 print '#' |
| 204 return files_to_rebaseline | 205 return files_to_rebaseline |
| 205 | 206 |
| 206 # Rebaseline a single file. | 207 # Rebaseline a single file. |
| 207 def _RebaselineOneFile(self, expectations_subdir, builder_name, | 208 def _RebaselineOneFile(self, expectations_subdir, builder_name, |
| 208 infilename, outfilename): | 209 infilename, outfilename): |
| 209 if self._dry_run: | 210 if self._dry_run: |
| 210 print '' | 211 print '' |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 outfilename=outfilename) | 271 outfilename=outfilename) |
| 271 | 272 |
| 272 # Rebaseline all platforms/tests/types we specified in the constructor. | 273 # Rebaseline all platforms/tests/types we specified in the constructor. |
| 273 def RebaselineAll(self): | 274 def RebaselineAll(self): |
| 274 for subdir in self._subdirs: | 275 for subdir in self._subdirs: |
| 275 if not subdir in SUBDIR_MAPPING.keys(): | 276 if not subdir in SUBDIR_MAPPING.keys(): |
| 276 raise Exception(('unrecognized platform subdir "%s"; ' + | 277 raise Exception(('unrecognized platform subdir "%s"; ' + |
| 277 'should be one of %s') % ( | 278 'should be one of %s') % ( |
| 278 subdir, SUBDIR_MAPPING.keys())) | 279 subdir, SUBDIR_MAPPING.keys())) |
| 279 builder_name = SUBDIR_MAPPING[subdir] | 280 builder_name = SUBDIR_MAPPING[subdir] |
| 281 json_url = '/'.join([self._json_base_url, | |
| 282 subdir, builder_name, subdir, | |
| 283 self._json_filename]) | |
| 284 | |
| 280 if self._tests: | 285 if self._tests: |
| 281 for test in self._tests: | 286 for test in self._tests: |
| 282 self._RebaselineOneTest(expectations_subdir=subdir, | 287 self._RebaselineOneTest(expectations_subdir=subdir, |
| 283 builder_name=builder_name, | 288 builder_name=builder_name, |
| 284 test=test) | 289 test=test) |
| 285 else: # get the raw list of files that need rebaselining from JSON | 290 else: # get the raw list of files that need rebaselining from JSON |
| 286 json_url = '/'.join([self._json_base_url, | |
| 287 subdir, builder_name, subdir, | |
| 288 self._json_filename]) | |
| 289 filenames = self._GetFilesToRebaseline(json_url=json_url, | 291 filenames = self._GetFilesToRebaseline(json_url=json_url, |
| 290 add_new=self._add_new) | 292 add_new=self._add_new) |
| 291 for filename in filenames: | 293 for filename in filenames: |
| 292 outfilename = os.path.join(subdir, filename); | 294 outfilename = os.path.join(subdir, filename); |
| 293 self._RebaselineOneFile(expectations_subdir=subdir, | 295 self._RebaselineOneFile(expectations_subdir=subdir, |
| 294 builder_name=builder_name, | 296 builder_name=builder_name, |
| 295 infilename=filename, | 297 infilename=filename, |
| 296 outfilename=outfilename) | 298 outfilename=outfilename) |
| 297 | 299 |
| 298 # main... | 300 # main... |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 329 '"--tests aaclip bigmatrix"; if unspecified, then all ' + | 331 '"--tests aaclip bigmatrix"; if unspecified, then all ' + |
| 330 'failing tests (according to the actual-results.json ' + | 332 'failing tests (according to the actual-results.json ' + |
| 331 'file) will be rebaselined.') | 333 'file) will be rebaselined.') |
| 332 args = parser.parse_args() | 334 args = parser.parse_args() |
| 333 rebaseliner = Rebaseliner(tests=args.tests, configs=args.configs, | 335 rebaseliner = Rebaseliner(tests=args.tests, configs=args.configs, |
| 334 subdirs=args.subdirs, dry_run=args.dry_run, | 336 subdirs=args.subdirs, dry_run=args.dry_run, |
| 335 json_base_url=args.json_base_url, | 337 json_base_url=args.json_base_url, |
| 336 json_filename=args.json_filename, | 338 json_filename=args.json_filename, |
| 337 add_new=args.add_new) | 339 add_new=args.add_new) |
| 338 rebaseliner.RebaselineAll() | 340 rebaseliner.RebaselineAll() |
| OLD | NEW |