Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py

Issue 2681733005: webkitpy: Consolidate code for MANIFEST.json into wpt_manifest.py (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 def _generate_manifest(self, dest_path): 188 def _generate_manifest(self, dest_path):
188 """Generates MANIFEST.json for imported tests. 189 """Generates MANIFEST.json for imported tests.
189 190
190 Args: 191 Args:
191 dest_path: Path to the destination WPT directory. 192 dest_path: Path to the destination WPT directory.
192 193
193 Runs the (newly-updated) manifest command if it's found, and then 194 Runs the (newly-updated) manifest command if it's found, and then
194 stages the generated MANIFEST.json in the git index, ready to commit. 195 stages the generated MANIFEST.json in the git index, ready to commit.
195 """ 196 """
196 manifest_command = self.finder.path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest')
197 if 'css' in dest_path: 197 if 'css' in dest_path:
198 # Do nothing for csswg-test. 198 # Do nothing for csswg-test.
199 return 199 return
200 _log.info('Generating MANIFEST.json') 200 _log.info('Generating MANIFEST.json')
201 self.run([manifest_command, '--work', '--tests-root', dest_path]) 201 WPTManifest.generate_manifest(self.host, dest_path)
202 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) 202 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')])
203 203
204 def update(self, dest_dir_name, temp_repo_path, revision): 204 def update(self, dest_dir_name, temp_repo_path, revision):
205 """Updates an imported repository. 205 """Updates an imported repository.
206 206
207 Args: 207 Args:
208 dest_dir_name: The destination directory name. 208 dest_dir_name: The destination directory name.
209 temp_repo_path: Path to local checkout of W3C test repo. 209 temp_repo_path: Path to local checkout of W3C test repo.
210 revision: A W3C test repo commit hash, or None. 210 revision: A W3C test repo commit hash, or None.
211 211
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 """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."""
444 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'])
445 renamed_tests = {} 445 renamed_tests = {}
446 for line in out.splitlines(): 446 for line in out.splitlines():
447 _, source_path, dest_path = line.split() 447 _, source_path, dest_path = line.split()
448 source_test = self.finder.layout_test_name(source_path) 448 source_test = self.finder.layout_test_name(source_path)
449 dest_test = self.finder.layout_test_name(dest_path) 449 dest_test = self.finder.layout_test_name(dest_path)
450 if source_test and dest_test: 450 if source_test and dest_test:
451 renamed_tests[source_test] = dest_test 451 renamed_tests[source_test] = dest_test
452 return renamed_tests 452 return renamed_tests
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698