| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 def _commit_changes(self, commit_message): | 220 def _commit_changes(self, commit_message): |
| 221 _log.info('Committing changes.') | 221 _log.info('Committing changes.') |
| 222 self.run(['git', 'commit', '--all', '-F', '-'], stdin=commit_message) | 222 self.run(['git', 'commit', '--all', '-F', '-'], stdin=commit_message) |
| 223 | 223 |
| 224 def _has_changes(self): | 224 def _has_changes(self): |
| 225 return_code, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_fa
ilure=False) | 225 return_code, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_fa
ilure=False) |
| 226 return return_code == 1 | 226 return return_code == 1 |
| 227 | 227 |
| 228 def _commit_message(self, chromium_commit, import_commit): | 228 def _commit_message(self, chromium_commit, import_commit): |
| 229 return ('Import %s\n\n' | 229 return ('Import %s\n\n' |
| 230 'Using update-w3c-deps in Chromium %s.\n\n' | 230 'Using wpt-import in Chromium %s.\n\n' |
| 231 'NOEXPORT=true' % | 231 'NOEXPORT=true' % |
| 232 (import_commit, chromium_commit)) | 232 (import_commit, chromium_commit)) |
| 233 | 233 |
| 234 @staticmethod | 234 @staticmethod |
| 235 def is_baseline(basename): | 235 def is_baseline(basename): |
| 236 # TODO(qyearsley): Find a better, centralized place for this. | 236 # TODO(qyearsley): Find a better, centralized place for this. |
| 237 return basename.endswith('-expected.txt') | 237 return basename.endswith('-expected.txt') |
| 238 | 238 |
| 239 def run(self, cmd, exit_on_failure=True, cwd=None, stdin=''): | 239 def run(self, cmd, exit_on_failure=True, cwd=None, stdin=''): |
| 240 _log.debug('Running command: %s', ' '.join(cmd)) | 240 _log.debug('Running command: %s', ' '.join(cmd)) |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 450 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
| 451 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 451 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
| 452 renamed_tests = {} | 452 renamed_tests = {} |
| 453 for line in out.splitlines(): | 453 for line in out.splitlines(): |
| 454 _, source_path, dest_path = line.split() | 454 _, source_path, dest_path = line.split() |
| 455 source_test = self.finder.layout_test_name(source_path) | 455 source_test = self.finder.layout_test_name(source_path) |
| 456 dest_test = self.finder.layout_test_name(dest_path) | 456 dest_test = self.finder.layout_test_name(dest_path) |
| 457 if source_test and dest_test: | 457 if source_test and dest_test: |
| 458 renamed_tests[source_test] = dest_test | 458 renamed_tests[source_test] = dest_test |
| 459 return renamed_tests | 459 return renamed_tests |
| OLD | NEW |