| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Fetches a copy of the latest state of a W3C test repository and commits. | 5 """Fetches a copy of the latest state of a W3C test repository and commits. |
| 6 | 6 |
| 7 If this script is given the argument --auto-update, it will also: | 7 If this script is given the argument --auto-update, it will also: |
| 8 1. Upload a CL. | 8 1. Upload a CL. |
| 9 2. Trigger try jobs and wait for them to complete. | 9 2. Trigger try jobs and wait for them to complete. |
| 10 3. Make any changes that are required for new failing tests. | 10 3. Make any changes that are required for new failing tests. |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 try_results = self.git_cl.wait_for_try_jobs( | 333 try_results = self.git_cl.wait_for_try_jobs( |
| 334 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) | 334 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) |
| 335 | 335 |
| 336 if not try_results: | 336 if not try_results: |
| 337 self.git_cl.run(['set-close']) | 337 self.git_cl.run(['set-close']) |
| 338 return False | 338 return False |
| 339 | 339 |
| 340 if try_results and self.git_cl.has_failing_try_results(try_results): | 340 if try_results and self.git_cl.has_failing_try_results(try_results): |
| 341 self.fetch_new_expectations_and_baselines() | 341 self.fetch_new_expectations_and_baselines() |
| 342 | 342 |
| 343 # Wait for CQ try jobs to finish. If there are failures, then abort. | 343 # Trigger CQ and wait for CQ try jobs to finish. |
| 344 self.git_cl.run(['set-commit', '--rietveld']) | 344 self.git_cl.run(['set-commit', '--rietveld']) |
| 345 try_results = self.git_cl.wait_for_try_jobs( | 345 try_results = self.git_cl.wait_for_try_jobs( |
| 346 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) | 346 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) |
| 347 | 347 |
| 348 if not try_results: | 348 if not try_results: |
| 349 _log.error('No try job results.') |
| 349 self.git_cl.run(['set-close']) | 350 self.git_cl.run(['set-close']) |
| 350 return False | 351 return False |
| 351 | 352 |
| 352 if self.git_cl.has_failing_try_results(try_results): | 353 # If the CQ passes, then the issue will be closed. |
| 353 _log.info('CQ failed; aborting.') | 354 if not self.git_cl.is_closed(): |
| 355 _log.error('CQ appears to have failed; aborting.') |
| 354 self.git_cl.run(['set-close']) | 356 self.git_cl.run(['set-close']) |
| 355 return False | 357 return False |
| 356 | 358 |
| 357 _log.info('Update completed.') | 359 _log.info('Update completed.') |
| 358 return True | 360 return True |
| 359 | 361 |
| 360 def _upload_cl(self): | 362 def _upload_cl(self): |
| 361 _log.info('Uploading change list.') | 363 _log.info('Uploading change list.') |
| 362 cc_list = self.get_directory_owners() | 364 cc_list = self.get_directory_owners() |
| 363 description = self._cl_description() | 365 description = self._cl_description() |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 443 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
| 442 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 444 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
| 443 renamed_tests = {} | 445 renamed_tests = {} |
| 444 for line in out.splitlines(): | 446 for line in out.splitlines(): |
| 445 _, source_path, dest_path = line.split() | 447 _, source_path, dest_path = line.split() |
| 446 source_test = self.finder.layout_test_name(source_path) | 448 source_test = self.finder.layout_test_name(source_path) |
| 447 dest_test = self.finder.layout_test_name(dest_path) | 449 dest_test = self.finder.layout_test_name(dest_path) |
| 448 if source_test and dest_test: | 450 if source_test and dest_test: |
| 449 renamed_tests[source_test] = dest_test | 451 renamed_tests[source_test] = dest_test |
| 450 return renamed_tests | 452 return renamed_tests |
| OLD | NEW |