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. |
11 4. Commit the CL. | 11 4. Commit the CL. |
12 | 12 |
13 If this script is given the argument --auto-update, it will also attempt to | 13 If this script is given the argument --auto-update, it will also attempt to |
14 upload a CL, trigger try jobs, and make any changes that are required for | 14 upload a CL, trigger try jobs, and make any changes that are required for |
15 new failing tests before committing. | 15 new failing tests before committing. |
16 """ | 16 """ |
17 | 17 |
18 import argparse | 18 import argparse |
19 import logging | 19 import logging |
20 | 20 |
21 from webkitpy.common.net.git_cl import GitCL | 21 from webkitpy.common.net.git_cl import GitCL |
22 from webkitpy.common.webkit_finder import WebKitFinder | 22 from webkitpy.common.webkit_finder import WebKitFinder |
23 from webkitpy.common.net.buildbot import current_build_link | 23 from webkitpy.common.net.buildbot import current_build_link |
24 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes
tExpectationParser | 24 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes
tExpectationParser |
25 from webkitpy.w3c.common import WPT_REPO_URL, CSS_REPO_URL, WPT_DEST_NAME, CSS_D
EST_NAME, exportable_commits_since | 25 from webkitpy.w3c.common import WPT_REPO_URL, CSS_REPO_URL, WPT_DEST_NAME, CSS_D
EST_NAME, exportable_commits_since |
26 from webkitpy.w3c.directory_owners_extractor import DirectoryOwnersExtractor | 26 from webkitpy.w3c.directory_owners_extractor import DirectoryOwnersExtractor |
27 from webkitpy.w3c.local_wpt import LocalWPT | 27 from webkitpy.w3c.local_wpt import LocalWPT |
28 from webkitpy.w3c.test_copier import TestCopier | 28 from webkitpy.w3c.test_copier import TestCopier |
29 from webkitpy.w3c.wpt_expectations_updater import WPTExpectationsUpdater | 29 from webkitpy.w3c.wpt_expectations_updater import WPTExpectationsUpdater |
| 30 from webkitpy.w3c.wpt_manifest import WPTManifest |
30 | 31 |
31 # Settings for how often to check try job results and how long to wait. | 32 # Settings for how often to check try job results and how long to wait. |
32 POLL_DELAY_SECONDS = 2 * 60 | 33 POLL_DELAY_SECONDS = 2 * 60 |
33 TIMEOUT_SECONDS = 180 * 60 | 34 TIMEOUT_SECONDS = 180 * 60 |
34 | 35 |
35 _log = logging.getLogger(__file__) | 36 _log = logging.getLogger(__file__) |
36 | 37 |
37 | 38 |
38 class TestImporter(object): | 39 class TestImporter(object): |
39 | 40 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 190 |
190 def _generate_manifest(self, dest_path): | 191 def _generate_manifest(self, dest_path): |
191 """Generates MANIFEST.json for imported tests. | 192 """Generates MANIFEST.json for imported tests. |
192 | 193 |
193 Args: | 194 Args: |
194 dest_path: Path to the destination WPT directory. | 195 dest_path: Path to the destination WPT directory. |
195 | 196 |
196 Runs the (newly-updated) manifest command if it's found, and then | 197 Runs the (newly-updated) manifest command if it's found, and then |
197 stages the generated MANIFEST.json in the git index, ready to commit. | 198 stages the generated MANIFEST.json in the git index, ready to commit. |
198 """ | 199 """ |
199 manifest_command = self.finder.path_from_webkit_base('Tools', 'Scripts',
'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest') | |
200 if 'css' in dest_path: | 200 if 'css' in dest_path: |
201 # Do nothing for csswg-test. | 201 # Do nothing for csswg-test. |
202 return | 202 return |
203 _log.info('Generating MANIFEST.json') | 203 _log.info('Generating MANIFEST.json') |
204 self.run([manifest_command, '--work', '--tests-root', dest_path]) | 204 WPTManifest.generate_manifest(self.host, dest_path) |
205 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) | 205 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) |
206 | 206 |
207 def update(self, dest_dir_name, temp_repo_path, revision): | 207 def update(self, dest_dir_name, temp_repo_path, revision): |
208 """Updates an imported repository. | 208 """Updates an imported repository. |
209 | 209 |
210 Args: | 210 Args: |
211 dest_dir_name: The destination directory name. | 211 dest_dir_name: The destination directory name. |
212 temp_repo_path: Path to local checkout of W3C test repo. | 212 temp_repo_path: Path to local checkout of W3C test repo. |
213 revision: A W3C test repo commit hash, or None. | 213 revision: A W3C test repo commit hash, or None. |
214 | 214 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 446 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
447 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 447 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
448 renamed_tests = {} | 448 renamed_tests = {} |
449 for line in out.splitlines(): | 449 for line in out.splitlines(): |
450 _, source_path, dest_path = line.split() | 450 _, source_path, dest_path = line.split() |
451 source_test = self.finder.layout_test_name(source_path) | 451 source_test = self.finder.layout_test_name(source_path) |
452 dest_test = self.finder.layout_test_name(dest_path) | 452 dest_test = self.finder.layout_test_name(dest_path) |
453 if source_test and dest_test: | 453 if source_test and dest_test: |
454 renamed_tests[source_test] = dest_test | 454 renamed_tests[source_test] = dest_test |
455 return renamed_tests | 455 return renamed_tests |
OLD | NEW |