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 attempt to | 7 If this script is given the argument --auto-update, it will also attempt to |
8 upload a CL, triggery try jobs, and make any changes that are required for | 8 upload a CL, triggery try jobs, and make any changes that are required for |
9 new failing tests before committing. | 9 new failing tests before committing. |
10 """ | 10 """ |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 def _generate_manifest(self, original_repo_path, dest_path): | 151 def _generate_manifest(self, original_repo_path, dest_path): |
152 """Generates MANIFEST.json for imported tests. | 152 """Generates MANIFEST.json for imported tests. |
153 | 153 |
154 Args: | 154 Args: |
155 original_repo_path: Path to the temporary source WPT repo directory. | 155 original_repo_path: Path to the temporary source WPT repo directory. |
156 dest_path: Path to the destination WPT directory. | 156 dest_path: Path to the destination WPT directory. |
157 | 157 |
158 Runs the (newly-updated) manifest command if it's found, and then | 158 Runs the (newly-updated) manifest command if it's found, and then |
159 stages the generated MANIFEST.json in the git index, ready to commit. | 159 stages the generated MANIFEST.json in the git index, ready to commit. |
160 """ | 160 """ |
161 manifest_command = self.fs.join(original_repo_path, 'manifest') | 161 manifest_command = self.finder.path_from_webkit_base('Tools', 'Scripts',
'webkitpy', 'thirdparty', 'wpt', 'manifest') |
162 if not self.fs.exists(manifest_command): | 162 if 'css' in dest_path: |
163 # Do nothing for csswg-test. | 163 # Do nothing for csswg-test. |
164 return | 164 return |
165 _log.info('Generating MANIFEST.json') | 165 _log.info('Generating MANIFEST.json') |
166 self.run([manifest_command, '--work', '--tests-root', dest_path]) | 166 self.run([manifest_command, '--work', '--tests-root', dest_path]) |
167 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) | 167 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) |
168 | 168 |
169 def update(self, dest_dir_name, url, keep_w3c_repos_around, revision): | 169 def update(self, dest_dir_name, url, keep_w3c_repos_around, revision): |
170 """Updates an imported repository. | 170 """Updates an imported repository. |
171 | 171 |
172 Args: | 172 Args: |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 452 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
453 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 453 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
454 renamed_tests = {} | 454 renamed_tests = {} |
455 for line in out.splitlines(): | 455 for line in out.splitlines(): |
456 _, source_path, dest_path = line.split() | 456 _, source_path, dest_path = line.split() |
457 source_test = self.finder.layout_test_name(source_path) | 457 source_test = self.finder.layout_test_name(source_path) |
458 dest_test = self.finder.layout_test_name(dest_path) | 458 dest_test = self.finder.layout_test_name(dest_path) |
459 if source_test and dest_test: | 459 if source_test and dest_test: |
460 renamed_tests[source_test] = dest_test | 460 renamed_tests[source_test] = dest_test |
461 return renamed_tests | 461 return renamed_tests |
OLD | NEW |