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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 self._upload_patchset(message) | 357 self._upload_patchset(message) |
358 | 358 |
359 # Trigger CQ and wait for CQ try jobs to finish. | 359 # Trigger CQ and wait for CQ try jobs to finish. |
360 self.git_cl.run(['set-commit', '--gerrit']) | 360 self.git_cl.run(['set-commit', '--gerrit']) |
361 try_results = self.git_cl.wait_for_try_jobs( | 361 try_results = self.git_cl.wait_for_try_jobs( |
362 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) | 362 poll_delay_seconds=POLL_DELAY_SECONDS, timeout_seconds=TIMEOUT_SECON
DS) |
363 | 363 |
364 _log.info('Try results: %s', try_results) | 364 _log.info('Try results: %s', try_results) |
365 | 365 |
366 # If the CQ passed, then the issue will be closed already. | 366 # If the CQ passed, then the issue will be closed already. |
367 status = self.git_cl.run(['status' '--field', 'status']).strip() | 367 status = self.git_cl.run(['status', '--field', 'status']).strip() |
368 _log.info('CL status: "%s"', status) | 368 _log.info('CL status: "%s"', status) |
369 if status not in ('lgtm', 'closed'): | 369 if status not in ('lgtm', 'closed'): |
370 _log.error('CQ appears to have failed; aborting.') | 370 _log.error('CQ appears to have failed; aborting.') |
371 self.git_cl.run(['set-close']) | 371 self.git_cl.run(['set-close']) |
372 return False | 372 return False |
373 | 373 |
374 _log.info('Update completed.') | 374 _log.info('Update completed.') |
375 return True | 375 return True |
376 | 376 |
377 def _upload_cl(self): | 377 def _upload_cl(self): |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 482 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
483 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 483 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
484 renamed_tests = {} | 484 renamed_tests = {} |
485 for line in out.splitlines(): | 485 for line in out.splitlines(): |
486 _, source_path, dest_path = line.split() | 486 _, source_path, dest_path = line.split() |
487 source_test = self.finder.layout_test_name(source_path) | 487 source_test = self.finder.layout_test_name(source_path) |
488 dest_test = self.finder.layout_test_name(dest_path) | 488 dest_test = self.finder.layout_test_name(dest_path) |
489 if source_test and dest_test: | 489 if source_test and dest_test: |
490 renamed_tests[source_test] = dest_test | 490 renamed_tests[source_test] = dest_test |
491 return renamed_tests | 491 return renamed_tests |
OLD | NEW |