| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 if port.test_configuration().build_type == 'release': | 340 if port.test_configuration().build_type == 'release': |
| 341 release_builders.append(builder_name) | 341 release_builders.append(builder_name) |
| 342 return release_builders | 342 return release_builders |
| 343 | 343 |
| 344 def _run_webkit_patch(self, args, verbose): | 344 def _run_webkit_patch(self, args, verbose): |
| 345 try: | 345 try: |
| 346 verbose_args = ['--verbose'] if verbose else [] | 346 verbose_args = ['--verbose'] if verbose else [] |
| 347 stderr = self._tool.executive.run_command([self._tool.path()] + verb
ose_args + args, cwd=self._tool.scm().checkout_root, return_stderr=True) | 347 stderr = self._tool.executive.run_command([self._tool.path()] + verb
ose_args + args, cwd=self._tool.scm().checkout_root, return_stderr=True) |
| 348 for line in stderr.splitlines(): | 348 for line in stderr.splitlines(): |
| 349 _log.warning(line) | 349 _log.warning(line) |
| 350 except ScriptError, e: | 350 except ScriptError: |
| 351 _log.error(e) | 351 traceback.print_exc(file=sys.stderr) |
| 352 | 352 |
| 353 def _builders_to_fetch_from(self, builders_to_check): | 353 def _builders_to_fetch_from(self, builders_to_check): |
| 354 # This routine returns the subset of builders that will cover all of the
baseline search paths | 354 # This routine returns the subset of builders that will cover all of the
baseline search paths |
| 355 # used in the input list. In particular, if the input list contains both
Release and Debug | 355 # used in the input list. In particular, if the input list contains both
Release and Debug |
| 356 # versions of a configuration, we *only* return the Release version (sin
ce we don't save | 356 # versions of a configuration, we *only* return the Release version (sin
ce we don't save |
| 357 # debug versions of baselines). | 357 # debug versions of baselines). |
| 358 release_builders = set() | 358 release_builders = set() |
| 359 debug_builders = set() | 359 debug_builders = set() |
| 360 builders_to_fallback_paths = {} | 360 builders_to_fallback_paths = {} |
| 361 for builder in builders_to_check: | 361 for builder in builders_to_check: |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 else: | 526 else: |
| 527 lines_to_remove[test] = extra_lines_to_remove[test] | 527 lines_to_remove[test] = extra_lines_to_remove[test] |
| 528 | 528 |
| 529 if lines_to_remove: | 529 if lines_to_remove: |
| 530 self._update_expectations_files(lines_to_remove) | 530 self._update_expectations_files(lines_to_remove) |
| 531 | 531 |
| 532 if options.optimize: | 532 if options.optimize: |
| 533 self._run_in_parallel_and_update_scm(self._optimize_baselines(test_p
refix_list, options.verbose)) | 533 self._run_in_parallel_and_update_scm(self._optimize_baselines(test_p
refix_list, options.verbose)) |
| 534 | 534 |
| 535 def _suffixes_for_actual_failures(self, test, builder_name, existing_suffixe
s): | 535 def _suffixes_for_actual_failures(self, test, builder_name, existing_suffixe
s): |
| 536 if builder_name not in self.builder_data(): |
| 537 return set() |
| 536 actual_results = self.builder_data()[builder_name].actual_results(test) | 538 actual_results = self.builder_data()[builder_name].actual_results(test) |
| 537 if not actual_results: | 539 if not actual_results: |
| 538 return set() | 540 return set() |
| 539 return set(existing_suffixes) & TestExpectations.suffixes_for_actual_exp
ectations_string(actual_results) | 541 return set(existing_suffixes) & TestExpectations.suffixes_for_actual_exp
ectations_string(actual_results) |
| 540 | 542 |
| 541 | 543 |
| 542 class RebaselineJson(AbstractParallelRebaselineCommand): | 544 class RebaselineJson(AbstractParallelRebaselineCommand): |
| 543 name = "rebaseline-json" | 545 name = "rebaseline-json" |
| 544 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be
called from other scripts." | 546 help_text = "Rebaseline based off JSON passed to stdin. Intended to only be
called from other scripts." |
| 545 | 547 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 # tree is closed. | 863 # tree is closed. |
| 862 did_finish = self._run_git_cl_command(options, ['upload', '-f']) | 864 did_finish = self._run_git_cl_command(options, ['upload', '-f']) |
| 863 | 865 |
| 864 if did_finish: | 866 if did_finish: |
| 865 # Uploading can take a very long time. Do another pull to make s
ure TestExpectations is up to date, | 867 # Uploading can take a very long time. Do another pull to make s
ure TestExpectations is up to date, |
| 866 # so the dcommit can go through. | 868 # so the dcommit can go through. |
| 867 # FIXME: Log the pull and dcommit stdout/stderr to the log-serve
r. | 869 # FIXME: Log the pull and dcommit stdout/stderr to the log-serve
r. |
| 868 tool.executive.run_command(['git', 'pull']) | 870 tool.executive.run_command(['git', 'pull']) |
| 869 | 871 |
| 870 self._run_git_cl_command(options, ['dcommit', '-f']) | 872 self._run_git_cl_command(options, ['dcommit', '-f']) |
| 871 except Exception as e: | 873 except: |
| 872 _log.error(e) | 874 traceback.print_exc(file=sys.stderr) |
| 873 finally: | 875 finally: |
| 874 if did_finish: | 876 if did_finish: |
| 875 self._run_git_cl_command(options, ['set_close']) | 877 self._run_git_cl_command(options, ['set_close']) |
| 876 tool.scm().ensure_cleanly_tracking_remote_master() | 878 tool.scm().ensure_cleanly_tracking_remote_master() |
| 877 tool.scm().checkout_branch(old_branch_name) | 879 tool.scm().checkout_branch(old_branch_name) |
| 878 tool.scm().delete_branch(self.AUTO_REBASELINE_BRANCH_NAME) | 880 tool.scm().delete_branch(self.AUTO_REBASELINE_BRANCH_NAME) |
| 879 | 881 |
| 880 | 882 |
| 881 class RebaselineOMatic(AbstractDeclarativeCommand): | 883 class RebaselineOMatic(AbstractDeclarativeCommand): |
| 882 name = "rebaseline-o-matic" | 884 name = "rebaseline-o-matic" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 self._tool.scm().checkout_branch(old_branch_name) | 951 self._tool.scm().checkout_branch(old_branch_name) |
| 950 else: | 952 else: |
| 951 self._log_queue.put(self.QUIT_LOG) | 953 self._log_queue.put(self.QUIT_LOG) |
| 952 log_thread.join() | 954 log_thread.join() |
| 953 | 955 |
| 954 def execute(self, options, args, tool): | 956 def execute(self, options, args, tool): |
| 955 self._verbose = options.verbose | 957 self._verbose = options.verbose |
| 956 while True: | 958 while True: |
| 957 self._do_one_rebaseline() | 959 self._do_one_rebaseline() |
| 958 time.sleep(self.SLEEP_TIME_IN_SECONDS) | 960 time.sleep(self.SLEEP_TIME_IN_SECONDS) |
| OLD | NEW |