| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 name = "rebaseline-json" | 527 name = "rebaseline-json" |
| 528 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be
called from other scripts." | 528 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be
called from other scripts." |
| 529 | 529 |
| 530 def __init__(self,): | 530 def __init__(self,): |
| 531 super(RebaselineJson, self).__init__(options=[ | 531 super(RebaselineJson, self).__init__(options=[ |
| 532 self.no_optimize_option, | 532 self.no_optimize_option, |
| 533 self.results_directory_option, | 533 self.results_directory_option, |
| 534 ]) | 534 ]) |
| 535 | 535 |
| 536 def execute(self, options, args, tool): | 536 def execute(self, options, args, tool): |
| 537 # TODO(crbug.com/574272) - Reenable this after the bug is fixed. |
| 538 _log.error("Rebaseline is broken at the moment. See crbug.com/574272.") |
| 539 return |
| 540 |
| 537 self._rebaseline(options, json.loads(sys.stdin.read())) | 541 self._rebaseline(options, json.loads(sys.stdin.read())) |
| 538 | 542 |
| 539 | 543 |
| 540 class RebaselineExpectations(AbstractParallelRebaselineCommand): | 544 class RebaselineExpectations(AbstractParallelRebaselineCommand): |
| 541 name = "rebaseline-expectations" | 545 name = "rebaseline-expectations" |
| 542 help_text = "Rebaselines the tests indicated in TestExpectations." | 546 help_text = "Rebaselines the tests indicated in TestExpectations." |
| 543 show_in_main_help = True | 547 show_in_main_help = True |
| 544 | 548 |
| 545 def __init__(self): | 549 def __init__(self): |
| 546 super(RebaselineExpectations, self).__init__(options=[ | 550 super(RebaselineExpectations, self).__init__(options=[ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 566 if tests: | 570 if tests: |
| 567 _log.info("Retrieving results for %s from %s." % (port_name, builder
_name)) | 571 _log.info("Retrieving results for %s from %s." % (port_name, builder
_name)) |
| 568 | 572 |
| 569 for test_name, suffixes in tests: | 573 for test_name, suffixes in tests: |
| 570 _log.info(" %s (%s)" % (test_name, ','.join(suffixes))) | 574 _log.info(" %s (%s)" % (test_name, ','.join(suffixes))) |
| 571 if test_name not in self._test_prefix_list: | 575 if test_name not in self._test_prefix_list: |
| 572 self._test_prefix_list[test_name] = {} | 576 self._test_prefix_list[test_name] = {} |
| 573 self._test_prefix_list[test_name][builder_name] = suffixes | 577 self._test_prefix_list[test_name][builder_name] = suffixes |
| 574 | 578 |
| 575 def execute(self, options, args, tool): | 579 def execute(self, options, args, tool): |
| 580 # TODO(crbug.com/574272) - Reenable this after the bug is fixed. |
| 581 _log.error("Rebaseline is broken at the moment. See crbug.com/574272.") |
| 582 return |
| 583 |
| 576 options.results_directory = None | 584 options.results_directory = None |
| 577 self._test_prefix_list = {} | 585 self._test_prefix_list = {} |
| 578 port_names = tool.port_factory.all_port_names(options.platform) | 586 port_names = tool.port_factory.all_port_names(options.platform) |
| 579 for port_name in port_names: | 587 for port_name in port_names: |
| 580 self._add_tests_to_rebaseline_for_port(port_name) | 588 self._add_tests_to_rebaseline_for_port(port_name) |
| 581 if not self._test_prefix_list: | 589 if not self._test_prefix_list: |
| 582 _log.warning("Did not find any tests marked Rebaseline.") | 590 _log.warning("Did not find any tests marked Rebaseline.") |
| 583 return | 591 return |
| 584 | 592 |
| 585 self._rebaseline(options, self._test_prefix_list) | 593 self._rebaseline(options, self._test_prefix_list) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 603 | 611 |
| 604 def _builders_to_pull_from(self): | 612 def _builders_to_pull_from(self): |
| 605 chosen_names = self._tool.user.prompt_with_list( | 613 chosen_names = self._tool.user.prompt_with_list( |
| 606 "Which builder to pull results from:", self._release_builders(), can
_choose_multiple=True) | 614 "Which builder to pull results from:", self._release_builders(), can
_choose_multiple=True) |
| 607 return [self._builder_with_name(name) for name in chosen_names] | 615 return [self._builder_with_name(name) for name in chosen_names] |
| 608 | 616 |
| 609 def _builder_with_name(self, name): | 617 def _builder_with_name(self, name): |
| 610 return self._tool.buildbot.builder_with_name(name) | 618 return self._tool.buildbot.builder_with_name(name) |
| 611 | 619 |
| 612 def execute(self, options, args, tool): | 620 def execute(self, options, args, tool): |
| 621 # TODO(crbug.com/574272) - Reenable this after the bug is fixed. |
| 622 _log.error("Rebaseline is broken at the moment. See crbug.com/574272.") |
| 623 return |
| 624 |
| 613 if not args: | 625 if not args: |
| 614 _log.error("Must list tests to rebaseline.") | 626 _log.error("Must list tests to rebaseline.") |
| 615 return | 627 return |
| 616 | 628 |
| 617 if options.builders: | 629 if options.builders: |
| 618 builders_to_check = [] | 630 builders_to_check = [] |
| 619 for builder_names in options.builders: | 631 for builder_names in options.builders: |
| 620 builders_to_check += [self._builder_with_name(name) for name in
builder_names.split(",")] | 632 builders_to_check += [self._builder_with_name(name) for name in
builder_names.split(",")] |
| 621 else: | 633 else: |
| 622 builders_to_check = self._builders_to_pull_from() | 634 builders_to_check = self._builders_to_pull_from() |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 issue_already_closed = tool.executive.run_command( | 907 issue_already_closed = tool.executive.run_command( |
| 896 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], | 908 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], |
| 897 return_exit_code=True) | 909 return_exit_code=True) |
| 898 if not issue_already_closed: | 910 if not issue_already_closed: |
| 899 self._run_git_cl_command(options, ['set_close']) | 911 self._run_git_cl_command(options, ['set_close']) |
| 900 | 912 |
| 901 tool.scm().ensure_cleanly_tracking_remote_master() | 913 tool.scm().ensure_cleanly_tracking_remote_master() |
| 902 if old_branch_name_or_ref: | 914 if old_branch_name_or_ref: |
| 903 tool.scm().checkout_branch(old_branch_name_or_ref) | 915 tool.scm().checkout_branch(old_branch_name_or_ref) |
| 904 tool.scm().delete_branch(rebaseline_branch_name) | 916 tool.scm().delete_branch(rebaseline_branch_name) |
| OLD | NEW |