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

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

Issue 2613753002: W3C import: Update manifest-updating step after upstream changes. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, wpt_subdir, filename) 142 destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, wpt_subdir, filename)
143 self.copyfile(source, destination) 143 self.copyfile(source, destination)
144 self.run(['git', 'add', destination]) 144 self.run(['git', 'add', destination])
145 for filename, wpt_subdir in resources_to_copy_from_wpt: 145 for filename, wpt_subdir in resources_to_copy_from_wpt:
146 source = self.path_from_webkit_base('LayoutTests', 'imported', WPT_D EST_NAME, wpt_subdir, filename) 146 source = self.path_from_webkit_base('LayoutTests', 'imported', WPT_D EST_NAME, wpt_subdir, filename)
147 destination = self.path_from_webkit_base('LayoutTests', 'resources', filename) 147 destination = self.path_from_webkit_base('LayoutTests', 'resources', filename)
148 self.copyfile(source, destination) 148 self.copyfile(source, destination)
149 self.run(['git', 'add', destination]) 149 self.run(['git', 'add', destination])
150 150
151 def _generate_manifest(self, original_repo_path, dest_path): 151 def _generate_manifest(self, original_repo_path, dest_path):
152 """Generate MANIFEST.json for imported tests. 152 """Generates MANIFEST.json for imported tests.
153 153
154 Run 'manifest' command if it exists in original_repo_path, and 154 Args:
155 add generated MANIFEST.json to dest_path. 155 original_repo_path: Path to the temporary source WPT repo directory.
156 dest_path: Path to the destination WPT directory.
157
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.
156 """ 160 """
157 manifest_command = self.fs.join(original_repo_path, 'manifest') 161 manifest_command = self.fs.join(original_repo_path, 'manifest')
158 if not self.fs.exists(manifest_command): 162 if not self.fs.exists(manifest_command):
159 # Do nothing for csswg-test. 163 # Do nothing for csswg-test.
160 return 164 return
161 _log.info('Generating MANIFEST.json') 165 _log.info('Generating MANIFEST.json')
162 self.run([manifest_command, '--tests-root', dest_path]) 166 self.run([manifest_command, '--work', '--tests-root', dest_path])
163 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) 167 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')])
164 168
165 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):
166 """Updates an imported repository. 170 """Updates an imported repository.
167 171
168 Args: 172 Args:
169 dest_dir_name: The destination directory name. 173 dest_dir_name: The destination directory name.
170 url: URL of the git repository. 174 url: URL of the git repository.
171 revision: Commit hash or None. 175 revision: Commit hash or None.
172 176
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 """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."""
449 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'])
450 renamed_tests = {} 454 renamed_tests = {}
451 for line in out.splitlines(): 455 for line in out.splitlines():
452 _, source_path, dest_path = line.split() 456 _, source_path, dest_path = line.split()
453 source_test = self.finder.layout_test_name(source_path) 457 source_test = self.finder.layout_test_name(source_path)
454 dest_test = self.finder.layout_test_name(dest_path) 458 dest_test = self.finder.layout_test_name(dest_path)
455 if source_test and dest_test: 459 if source_test and dest_test:
456 renamed_tests[source_test] = dest_test 460 renamed_tests[source_test] = dest_test
457 return renamed_tests 461 return renamed_tests
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698