| OLD | NEW |
| 1 # Copyright (c) 2010 Google Inc. All rights reserved. | 1 # Copyright (c) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 for suffix in options.suffixes.split(','): | 179 for suffix in options.suffixes.split(','): |
| 180 self._copy_existing_baseline(options.builder, options.test, suffix) | 180 self._copy_existing_baseline(options.builder, options.test, suffix) |
| 181 print json.dumps(self._scm_changes) | 181 print json.dumps(self._scm_changes) |
| 182 | 182 |
| 183 | 183 |
| 184 class RebaselineTest(BaseInternalRebaselineCommand): | 184 class RebaselineTest(BaseInternalRebaselineCommand): |
| 185 name = "rebaseline-test-internal" | 185 name = "rebaseline-test-internal" |
| 186 help_text = "Rebaseline a single test from a buildbot. Only intended for use
by other webkit-patch commands." | 186 help_text = "Rebaseline a single test from a buildbot. Only intended for use
by other webkit-patch commands." |
| 187 | 187 |
| 188 def _results_url(self, builder_name): | 188 def _results_url(self, builder_name): |
| 189 return self._tool.buildbot_for_builder_name(builder_name).builder_with_n
ame(builder_name).latest_layout_test_results_url() | 189 return self._tool.buildbot.builder_with_name(builder_name).latest_layout
_test_results_url() |
| 190 | 190 |
| 191 def _save_baseline(self, data, target_baseline, baseline_directory, test_nam
e, suffix): | 191 def _save_baseline(self, data, target_baseline, baseline_directory, test_nam
e, suffix): |
| 192 if not data: | 192 if not data: |
| 193 _log.debug("No baseline data to save.") | 193 _log.debug("No baseline data to save.") |
| 194 return | 194 return |
| 195 | 195 |
| 196 filesystem = self._tool.filesystem | 196 filesystem = self._tool.filesystem |
| 197 filesystem.maybe_make_directory(filesystem.dirname(target_baseline)) | 197 filesystem.maybe_make_directory(filesystem.dirname(target_baseline)) |
| 198 filesystem.write_binary_file(target_baseline, data) | 198 filesystem.write_binary_file(target_baseline, data) |
| 199 if not self._tool.scm().exists(target_baseline): | 199 if not self._tool.scm().exists(target_baseline): |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): | 315 class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): |
| 316 # not overriding execute() - pylint: disable=W0223 | 316 # not overriding execute() - pylint: disable=W0223 |
| 317 | 317 |
| 318 def __init__(self, options=None): | 318 def __init__(self, options=None): |
| 319 super(AbstractParallelRebaselineCommand, self).__init__(options=options) | 319 super(AbstractParallelRebaselineCommand, self).__init__(options=options) |
| 320 self._builder_data = {} | 320 self._builder_data = {} |
| 321 | 321 |
| 322 def builder_data(self): | 322 def builder_data(self): |
| 323 if not self._builder_data: | 323 if not self._builder_data: |
| 324 for builder_name in self._release_builders(): | 324 for builder_name in self._release_builders(): |
| 325 builder = self._tool.buildbot_for_builder_name(builder_name).bui
lder_with_name(builder_name) | 325 builder = self._tool.buildbot.builder_with_name(builder_name) |
| 326 self._builder_data[builder_name] = builder.latest_layout_test_re
sults() | 326 self._builder_data[builder_name] = builder.latest_layout_test_re
sults() |
| 327 return self._builder_data | 327 return self._builder_data |
| 328 | 328 |
| 329 # The release builders cycle much faster than the debug ones and cover all t
he platforms. | 329 # The release builders cycle much faster than the debug ones and cover all t
he platforms. |
| 330 def _release_builders(self): | 330 def _release_builders(self): |
| 331 release_builders = [] | 331 release_builders = [] |
| 332 for builder_name in builders.all_builder_names(): | 332 for builder_name in builders.all_builder_names(): |
| 333 if builder_name.find('ASAN') != -1: | 333 if builder_name.find('ASAN') != -1: |
| 334 continue | 334 continue |
| 335 port = self._tool.port_factory.get_from_builder_name(builder_name) | 335 port = self._tool.port_factory.get_from_builder_name(builder_name) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 self.suffixes_option, | 610 self.suffixes_option, |
| 611 self.results_directory_option, | 611 self.results_directory_option, |
| 612 optparse.make_option("--builders", default=None, action="append", he
lp="Comma-separated-list of builders to pull new baselines from (can also be pro
vided multiple times)"), | 612 optparse.make_option("--builders", default=None, action="append", he
lp="Comma-separated-list of builders to pull new baselines from (can also be pro
vided multiple times)"), |
| 613 ]) | 613 ]) |
| 614 | 614 |
| 615 def _builders_to_pull_from(self): | 615 def _builders_to_pull_from(self): |
| 616 chosen_names = self._tool.user.prompt_with_list("Which builder to pull r
esults from:", self._release_builders(), can_choose_multiple=True) | 616 chosen_names = self._tool.user.prompt_with_list("Which builder to pull r
esults from:", self._release_builders(), can_choose_multiple=True) |
| 617 return [self._builder_with_name(name) for name in chosen_names] | 617 return [self._builder_with_name(name) for name in chosen_names] |
| 618 | 618 |
| 619 def _builder_with_name(self, name): | 619 def _builder_with_name(self, name): |
| 620 return self._tool.buildbot_for_builder_name(name).builder_with_name(name
) | 620 return self._tool.buildbot.builder_with_name(name) |
| 621 | 621 |
| 622 def execute(self, options, args, tool): | 622 def execute(self, options, args, tool): |
| 623 if not args: | 623 if not args: |
| 624 _log.error("Must list tests to rebaseline.") | 624 _log.error("Must list tests to rebaseline.") |
| 625 return | 625 return |
| 626 | 626 |
| 627 if options.builders: | 627 if options.builders: |
| 628 builders_to_check = [] | 628 builders_to_check = [] |
| 629 for builder_names in options.builders: | 629 for builder_names in options.builders: |
| 630 builders_to_check += [self._builder_with_name(name) for name in
builder_names.split(",")] | 630 builders_to_check += [self._builder_with_name(name) for name in
builder_names.split(",")] |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 self._tool.scm().checkout_branch(old_branch_name) | 934 self._tool.scm().checkout_branch(old_branch_name) |
| 935 else: | 935 else: |
| 936 self._log_queue.put(self.QUIT_LOG) | 936 self._log_queue.put(self.QUIT_LOG) |
| 937 log_thread.join() | 937 log_thread.join() |
| 938 | 938 |
| 939 def execute(self, options, args, tool): | 939 def execute(self, options, args, tool): |
| 940 self._verbose = options.verbose | 940 self._verbose = options.verbose |
| 941 while True: | 941 while True: |
| 942 self._do_one_rebaseline() | 942 self._do_one_rebaseline() |
| 943 time.sleep(self.SLEEP_TIME_IN_SECONDS) | 943 time.sleep(self.SLEEP_TIME_IN_SECONDS) |
| OLD | NEW |