| 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 """ |
| 11 | 11 |
| 12 import logging | 12 import logging |
| 13 import argparse | 13 import argparse |
| 14 import json | 14 import json |
| 15 | 15 |
| 16 from webkitpy.common.net.git_cl import GitCL | 16 from webkitpy.common.net.git_cl import GitCL |
| 17 from webkitpy.common.webkit_finder import WebKitFinder | 17 from webkitpy.common.blink_finder import BlinkFinder |
| 18 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes
tExpectationParser | 18 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes
tExpectationParser |
| 19 | 19 |
| 20 # Import destination directories (under LayoutTests/imported/). | 20 # Import destination directories (under LayoutTests/imported/). |
| 21 WPT_DEST_NAME = 'wpt' | 21 WPT_DEST_NAME = 'wpt' |
| 22 CSS_DEST_NAME = 'csswg-test' | 22 CSS_DEST_NAME = 'csswg-test' |
| 23 | 23 |
| 24 # Our mirrors of the official w3c repos, which we pull from. | 24 # Our mirrors of the official w3c repos, which we pull from. |
| 25 WPT_REPO_URL = 'https://chromium.googlesource.com/external/w3c/web-platform-test
s.git' | 25 WPT_REPO_URL = 'https://chromium.googlesource.com/external/w3c/web-platform-test
s.git' |
| 26 CSS_REPO_URL = 'https://chromium.googlesource.com/external/w3c/csswg-test.git' | 26 CSS_REPO_URL = 'https://chromium.googlesource.com/external/w3c/csswg-test.git' |
| 27 | 27 |
| 28 | 28 |
| 29 _log = logging.getLogger(__file__) | 29 _log = logging.getLogger(__file__) |
| 30 | 30 |
| 31 | 31 |
| 32 class DepsUpdater(object): | 32 class DepsUpdater(object): |
| 33 | 33 |
| 34 def __init__(self, host): | 34 def __init__(self, host): |
| 35 self.host = host | 35 self.host = host |
| 36 self.executive = host.executive | 36 self.executive = host.executive |
| 37 self.fs = host.filesystem | 37 self.fs = host.filesystem |
| 38 self.finder = WebKitFinder(self.fs) | 38 self.finder = BlinkFinder(self.fs) |
| 39 self.verbose = False | 39 self.verbose = False |
| 40 self.git_cl = None | 40 self.git_cl = None |
| 41 | 41 |
| 42 def main(self, argv=None): | 42 def main(self, argv=None): |
| 43 options = self.parse_args(argv) | 43 options = self.parse_args(argv) |
| 44 self.verbose = options.verbose | 44 self.verbose = options.verbose |
| 45 log_level = logging.DEBUG if self.verbose else logging.INFO | 45 log_level = logging.DEBUG if self.verbose else logging.INFO |
| 46 logging.basicConfig(level=log_level, format='%(message)s') | 46 logging.basicConfig(level=log_level, format='%(message)s') |
| 47 | 47 |
| 48 if not self.checkout_is_okay(options.allow_local_commits): | 48 if not self.checkout_is_okay(options.allow_local_commits): |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 git_diff_retcode, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_
on_failure=False) | 92 git_diff_retcode, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_
on_failure=False) |
| 93 if git_diff_retcode: | 93 if git_diff_retcode: |
| 94 _log.warning('Checkout is dirty; aborting.') | 94 _log.warning('Checkout is dirty; aborting.') |
| 95 return False | 95 return False |
| 96 | 96 |
| 97 local_commits = self.run(['git', 'log', '--oneline', 'origin/master..HEA
D'])[1] | 97 local_commits = self.run(['git', 'log', '--oneline', 'origin/master..HEA
D'])[1] |
| 98 if local_commits and not allow_local_commits: | 98 if local_commits and not allow_local_commits: |
| 99 _log.warning('Checkout has local commits; aborting. Use --allow-loca
l-commits to allow this.') | 99 _log.warning('Checkout has local commits; aborting. Use --allow-loca
l-commits to allow this.') |
| 100 return False | 100 return False |
| 101 | 101 |
| 102 if self.fs.exists(self.path_from_webkit_base(WPT_DEST_NAME)): | 102 if self.fs.exists(self.path_from_blink_base(WPT_DEST_NAME)): |
| 103 _log.warning('WebKit/%s exists; aborting.', WPT_DEST_NAME) | 103 _log.warning('WebKit/%s exists; aborting.', WPT_DEST_NAME) |
| 104 return False | 104 return False |
| 105 | 105 |
| 106 if self.fs.exists(self.path_from_webkit_base(CSS_DEST_NAME)): | 106 if self.fs.exists(self.path_from_blink_base(CSS_DEST_NAME)): |
| 107 _log.warning('WebKit/%s repo exists; aborting.', CSS_DEST_NAME) | 107 _log.warning('WebKit/%s repo exists; aborting.', CSS_DEST_NAME) |
| 108 return False | 108 return False |
| 109 | 109 |
| 110 return True | 110 return True |
| 111 | 111 |
| 112 def _copy_resources(self): | 112 def _copy_resources(self): |
| 113 """Copies resources from LayoutTests/resources to wpt and vice versa. | 113 """Copies resources from LayoutTests/resources to wpt and vice versa. |
| 114 | 114 |
| 115 There are resources from our repository that we use instead of the | 115 There are resources from our repository that we use instead of the |
| 116 upstream versions. Conversely, there are also some resources that | 116 upstream versions. Conversely, there are also some resources that |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 resources_to_copy_to_wpt = [ | 131 resources_to_copy_to_wpt = [ |
| 132 ('testharnessreport.js', 'resources'), | 132 ('testharnessreport.js', 'resources'), |
| 133 ('WebIDLParser.js', 'resources'), | 133 ('WebIDLParser.js', 'resources'), |
| 134 ('vendor-prefix.js', 'common'), | 134 ('vendor-prefix.js', 'common'), |
| 135 ] | 135 ] |
| 136 resources_to_copy_from_wpt = [ | 136 resources_to_copy_from_wpt = [ |
| 137 ('idlharness.js', 'resources'), | 137 ('idlharness.js', 'resources'), |
| 138 ('testharness.js', 'resources'), | 138 ('testharness.js', 'resources'), |
| 139 ] | 139 ] |
| 140 for filename, wpt_subdir in resources_to_copy_to_wpt: | 140 for filename, wpt_subdir in resources_to_copy_to_wpt: |
| 141 source = self.path_from_webkit_base('LayoutTests', 'resources', file
name) | 141 source = self.path_from_blink_base('LayoutTests', 'resources', filen
ame) |
| 142 destination = self.path_from_webkit_base('LayoutTests', 'imported',
WPT_DEST_NAME, wpt_subdir, filename) | 142 destination = self.path_from_blink_base('LayoutTests', 'imported', W
PT_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_blink_base('LayoutTests', 'imported', WPT_DE
ST_NAME, wpt_subdir, filename) |
| 147 destination = self.path_from_webkit_base('LayoutTests', 'resources',
filename) | 147 destination = self.path_from_blink_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 """Generate MANIFEST.json for imported tests. |
| 153 | 153 |
| 154 Run 'manifest' command if it exists in original_repo_path, and | 154 Run 'manifest' command if it exists in original_repo_path, and |
| 155 add generated MANIFEST.json to dest_path. | 155 add generated MANIFEST.json to dest_path. |
| 156 """ | 156 """ |
| 157 manifest_command = self.fs.join(original_repo_path, 'manifest') | 157 manifest_command = self.fs.join(original_repo_path, 'manifest') |
| 158 if not self.fs.exists(manifest_command): | 158 if not self.fs.exists(manifest_command): |
| 159 # Do nothing for csswg-test. | 159 # Do nothing for csswg-test. |
| 160 return | 160 return |
| 161 _log.info('Generating MANIFEST.json') | 161 _log.info('Generating MANIFEST.json') |
| 162 self.run([manifest_command, '--tests-root', dest_path]) | 162 self.run([manifest_command, '--tests-root', dest_path]) |
| 163 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) | 163 self.run(['git', 'add', self.fs.join(dest_path, 'MANIFEST.json')]) |
| 164 | 164 |
| 165 def update(self, dest_dir_name, url, keep_w3c_repos_around, revision): | 165 def update(self, dest_dir_name, url, keep_w3c_repos_around, revision): |
| 166 """Updates an imported repository. | 166 """Updates an imported repository. |
| 167 | 167 |
| 168 Args: | 168 Args: |
| 169 dest_dir_name: The destination directory name. | 169 dest_dir_name: The destination directory name. |
| 170 url: URL of the git repository. | 170 url: URL of the git repository. |
| 171 revision: Commit hash or None. | 171 revision: Commit hash or None. |
| 172 | 172 |
| 173 Returns: | 173 Returns: |
| 174 A string for the commit description "<destination>@<commitish>". | 174 A string for the commit description "<destination>@<commitish>". |
| 175 """ | 175 """ |
| 176 temp_repo_path = self.path_from_webkit_base(dest_dir_name) | 176 temp_repo_path = self.path_from_blink_base(dest_dir_name) |
| 177 _log.info('Cloning %s into %s.', url, temp_repo_path) | 177 _log.info('Cloning %s into %s.', url, temp_repo_path) |
| 178 self.run(['git', 'clone', url, temp_repo_path]) | 178 self.run(['git', 'clone', url, temp_repo_path]) |
| 179 | 179 |
| 180 if revision is not None: | 180 if revision is not None: |
| 181 _log.info('Checking out %s', revision) | 181 _log.info('Checking out %s', revision) |
| 182 self.run(['git', 'checkout', revision], cwd=temp_repo_path) | 182 self.run(['git', 'checkout', revision], cwd=temp_repo_path) |
| 183 self.run(['git', 'submodule', 'update', '--init', '--recursive'], cwd=te
mp_repo_path) | 183 self.run(['git', 'submodule', 'update', '--init', '--recursive'], cwd=te
mp_repo_path) |
| 184 | 184 |
| 185 _log.info('Noting the revision we are importing.') | 185 _log.info('Noting the revision we are importing.') |
| 186 _, show_ref_output = self.run(['git', 'show-ref', 'origin/master'], cwd=
temp_repo_path) | 186 _, show_ref_output = self.run(['git', 'show-ref', 'origin/master'], cwd=
temp_repo_path) |
| 187 master_commitish = show_ref_output.split()[0] | 187 master_commitish = show_ref_output.split()[0] |
| 188 | 188 |
| 189 _log.info('Cleaning out tests from LayoutTests/imported/%s.', dest_dir_n
ame) | 189 _log.info('Cleaning out tests from LayoutTests/imported/%s.', dest_dir_n
ame) |
| 190 dest_path = self.path_from_webkit_base('LayoutTests', 'imported', dest_d
ir_name) | 190 dest_path = self.path_from_blink_base('LayoutTests', 'imported', dest_di
r_name) |
| 191 files_to_delete = self.fs.files_under(dest_path, file_filter=self.is_not
_baseline) | 191 files_to_delete = self.fs.files_under(dest_path, file_filter=self.is_not
_baseline) |
| 192 for subpath in files_to_delete: | 192 for subpath in files_to_delete: |
| 193 self.remove('LayoutTests', 'imported', subpath) | 193 self.remove('LayoutTests', 'imported', subpath) |
| 194 | 194 |
| 195 _log.info('Importing the tests.') | 195 _log.info('Importing the tests.') |
| 196 src_repo = self.path_from_webkit_base(dest_dir_name) | 196 src_repo = self.path_from_blink_base(dest_dir_name) |
| 197 import_path = self.path_from_webkit_base('Tools', 'Scripts', 'import-w3c
-tests') | 197 import_path = self.path_from_blink_base('Tools', 'Scripts', 'import-w3c-
tests') |
| 198 self.run([self.host.executable, import_path, '-d', 'imported', src_repo]
) | 198 self.run([self.host.executable, import_path, '-d', 'imported', src_repo]
) |
| 199 | 199 |
| 200 self.run(['git', 'add', '--all', 'LayoutTests/imported/%s' % dest_dir_na
me]) | 200 self.run(['git', 'add', '--all', 'LayoutTests/imported/%s' % dest_dir_na
me]) |
| 201 | 201 |
| 202 _log.info('Deleting any orphaned baselines.') | 202 _log.info('Deleting any orphaned baselines.') |
| 203 previous_baselines = self.fs.files_under(dest_path, file_filter=self.is_
baseline) | 203 previous_baselines = self.fs.files_under(dest_path, file_filter=self.is_
baseline) |
| 204 for subpath in previous_baselines: | 204 for subpath in previous_baselines: |
| 205 full_path = self.fs.join(dest_path, subpath) | 205 full_path = self.fs.join(dest_path, subpath) |
| 206 if self.fs.glob(full_path.replace('-expected.txt', '*')) == [full_pa
th]: | 206 if self.fs.glob(full_path.replace('-expected.txt', '*')) == [full_pa
th]: |
| 207 self.fs.remove(full_path) | 207 self.fs.remove(full_path) |
| 208 | 208 |
| 209 self._generate_manifest(temp_repo_path, dest_path) | 209 self._generate_manifest(temp_repo_path, dest_path) |
| 210 if not keep_w3c_repos_around: | 210 if not keep_w3c_repos_around: |
| 211 _log.info('Deleting temp repo directory %s.', temp_repo_path) | 211 _log.info('Deleting temp repo directory %s.', temp_repo_path) |
| 212 self.rmtree(temp_repo_path) | 212 self.rmtree(temp_repo_path) |
| 213 | 213 |
| 214 _log.info('Updating TestExpectations for any removed or renamed tests.') | 214 _log.info('Updating TestExpectations for any removed or renamed tests.') |
| 215 self.update_all_test_expectations_files(self._list_deleted_tests(), self
._list_renamed_tests()) | 215 self.update_all_test_expectations_files(self._list_deleted_tests(), self
._list_renamed_tests()) |
| 216 | 216 |
| 217 return '%s@%s' % (dest_dir_name, master_commitish) | 217 return '%s@%s' % (dest_dir_name, master_commitish) |
| 218 | 218 |
| 219 def commit_changes_if_needed(self, chromium_commitish, import_commitish): | 219 def commit_changes_if_needed(self, chromium_commitish, import_commitish): |
| 220 if self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_failure=False)[0
]: | 220 if self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_failure=False)[0
]: |
| 221 _log.info('Committing changes.') | 221 _log.info('Committing changes.') |
| 222 commit_msg = ('Import %s\n' | 222 commit_msg = ('Import %s\n' |
| 223 '\n' | 223 '\n' |
| 224 'Using update-w3c-deps in Chromium %s.\n' | 224 'Using update-w3c-deps in Chromium %s.\n' |
| 225 % (import_commitish, chromium_commitish)) | 225 % (import_commitish, chromium_commitish)) |
| 226 path_to_commit_msg = self.path_from_webkit_base('commit_msg') | 226 path_to_commit_msg = self.path_from_blink_base('commit_msg') |
| 227 _log.debug('cat > %s <<EOF', path_to_commit_msg) | 227 _log.debug('cat > %s <<EOF', path_to_commit_msg) |
| 228 _log.debug(commit_msg) | 228 _log.debug(commit_msg) |
| 229 _log.debug('EOF') | 229 _log.debug('EOF') |
| 230 self.fs.write_text_file(path_to_commit_msg, commit_msg) | 230 self.fs.write_text_file(path_to_commit_msg, commit_msg) |
| 231 self.run(['git', 'commit', '-a', '-F', path_to_commit_msg]) | 231 self.run(['git', 'commit', '-a', '-F', path_to_commit_msg]) |
| 232 self.remove(path_to_commit_msg) | 232 self.remove(path_to_commit_msg) |
| 233 _log.info('Done: changes imported and committed.') | 233 _log.info('Done: changes imported and committed.') |
| 234 return True | 234 return True |
| 235 else: | 235 else: |
| 236 _log.info('Done: no changes to import.') | 236 _log.info('Done: no changes to import.') |
| 237 return False | 237 return False |
| 238 | 238 |
| 239 # Callback for FileSystem.files_under; not all arguments used - pylint: disa
ble=unused-argument | 239 # Callback for FileSystem.files_under; not all arguments used - pylint: disa
ble=unused-argument |
| 240 def is_baseline(self, fs, dirname, basename): | 240 def is_baseline(self, fs, dirname, basename): |
| 241 return basename.endswith('-expected.txt') | 241 return basename.endswith('-expected.txt') |
| 242 | 242 |
| 243 def is_not_baseline(self, fs, dirname, basename): | 243 def is_not_baseline(self, fs, dirname, basename): |
| 244 return not self.is_baseline(fs, dirname, basename) | 244 return not self.is_baseline(fs, dirname, basename) |
| 245 | 245 |
| 246 def run(self, cmd, exit_on_failure=True, cwd=None): | 246 def run(self, cmd, exit_on_failure=True, cwd=None): |
| 247 _log.debug('Running command: %s', ' '.join(cmd)) | 247 _log.debug('Running command: %s', ' '.join(cmd)) |
| 248 | 248 |
| 249 cwd = cwd or self.finder.webkit_base() | 249 cwd = cwd or self.finder.blink_base() |
| 250 proc = self.executive.popen(cmd, stdout=self.executive.PIPE, stderr=self
.executive.PIPE, cwd=cwd) | 250 proc = self.executive.popen(cmd, stdout=self.executive.PIPE, stderr=self
.executive.PIPE, cwd=cwd) |
| 251 out, err = proc.communicate() | 251 out, err = proc.communicate() |
| 252 if proc.returncode or self.verbose: | 252 if proc.returncode or self.verbose: |
| 253 _log.info('# ret> %d', proc.returncode) | 253 _log.info('# ret> %d', proc.returncode) |
| 254 if out: | 254 if out: |
| 255 for line in out.splitlines(): | 255 for line in out.splitlines(): |
| 256 _log.info('# out> %s', line) | 256 _log.info('# out> %s', line) |
| 257 if err: | 257 if err: |
| 258 for line in err.splitlines(): | 258 for line in err.splitlines(): |
| 259 _log.info('# err> %s', line) | 259 _log.info('# err> %s', line) |
| 260 if exit_on_failure and proc.returncode: | 260 if exit_on_failure and proc.returncode: |
| 261 self.host.exit(proc.returncode) | 261 self.host.exit(proc.returncode) |
| 262 return proc.returncode, out | 262 return proc.returncode, out |
| 263 | 263 |
| 264 def check_run(self, command): | 264 def check_run(self, command): |
| 265 return_code, out = self.run(command) | 265 return_code, out = self.run(command) |
| 266 if return_code: | 266 if return_code: |
| 267 raise Exception('%s failed with exit code %d.' % ' '.join(command),
return_code) | 267 raise Exception('%s failed with exit code %d.' % ' '.join(command),
return_code) |
| 268 return out | 268 return out |
| 269 | 269 |
| 270 def copyfile(self, source, destination): | 270 def copyfile(self, source, destination): |
| 271 _log.debug('cp %s %s', source, destination) | 271 _log.debug('cp %s %s', source, destination) |
| 272 self.fs.copyfile(source, destination) | 272 self.fs.copyfile(source, destination) |
| 273 | 273 |
| 274 def remove(self, *comps): | 274 def remove(self, *comps): |
| 275 dest = self.path_from_webkit_base(*comps) | 275 dest = self.path_from_blink_base(*comps) |
| 276 _log.debug('rm %s', dest) | 276 _log.debug('rm %s', dest) |
| 277 self.fs.remove(dest) | 277 self.fs.remove(dest) |
| 278 | 278 |
| 279 def rmtree(self, *comps): | 279 def rmtree(self, *comps): |
| 280 dest = self.path_from_webkit_base(*comps) | 280 dest = self.path_from_blink_base(*comps) |
| 281 _log.debug('rm -fr %s', dest) | 281 _log.debug('rm -fr %s', dest) |
| 282 self.fs.rmtree(dest) | 282 self.fs.rmtree(dest) |
| 283 | 283 |
| 284 def path_from_webkit_base(self, *comps): | 284 def path_from_blink_base(self, *comps): |
| 285 return self.finder.path_from_webkit_base(*comps) | 285 return self.finder.path_from_blink_base(*comps) |
| 286 | 286 |
| 287 def do_auto_update(self): | 287 def do_auto_update(self): |
| 288 """Attempts to upload a CL, make any required adjustments, and commit. | 288 """Attempts to upload a CL, make any required adjustments, and commit. |
| 289 | 289 |
| 290 This function assumes that the imported repo has already been updated, | 290 This function assumes that the imported repo has already been updated, |
| 291 and that change has been committed. There may be newly-failing tests, | 291 and that change has been committed. There may be newly-failing tests, |
| 292 so before being able to commit these new changes, we may need to update | 292 so before being able to commit these new changes, we may need to update |
| 293 TestExpectations or download new baselines. | 293 TestExpectations or download new baselines. |
| 294 | 294 |
| 295 Returns: | 295 Returns: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 'upload', | 332 'upload', |
| 333 '-f', | 333 '-f', |
| 334 '--rietveld', | 334 '--rietveld', |
| 335 '-m', | 335 '-m', |
| 336 commit_message, | 336 commit_message, |
| 337 ] + ['--cc=' + email for email in cc_list]) | 337 ] + ['--cc=' + email for email in cc_list]) |
| 338 | 338 |
| 339 def get_directory_owners_to_cc(self): | 339 def get_directory_owners_to_cc(self): |
| 340 """Returns a list of email addresses to CC for the current import.""" | 340 """Returns a list of email addresses to CC for the current import.""" |
| 341 _log.info('Gathering directory owners emails to CC.') | 341 _log.info('Gathering directory owners emails to CC.') |
| 342 directory_owners_file_path = self.finder.path_from_webkit_base( | 342 directory_owners_file_path = self.finder.path_from_blink_base( |
| 343 'Tools', 'Scripts', 'webkitpy', 'w3c', 'directory_owners.json') | 343 'Tools', 'Scripts', 'webkitpy', 'w3c', 'directory_owners.json') |
| 344 with open(directory_owners_file_path) as data_file: | 344 with open(directory_owners_file_path) as data_file: |
| 345 directory_to_owner = self.parse_directory_owners(json.load(data_file
)) | 345 directory_to_owner = self.parse_directory_owners(json.load(data_file
)) |
| 346 out = self.check_run(['git', 'diff', 'origin/master', '--name-only']) | 346 out = self.check_run(['git', 'diff', 'origin/master', '--name-only']) |
| 347 changed_files = out.splitlines() | 347 changed_files = out.splitlines() |
| 348 return self.generate_email_list(changed_files, directory_to_owner) | 348 return self.generate_email_list(changed_files, directory_to_owner) |
| 349 | 349 |
| 350 @staticmethod | 350 @staticmethod |
| 351 def parse_directory_owners(decoded_data_file): | 351 def parse_directory_owners(decoded_data_file): |
| 352 directory_dict = {} | 352 directory_dict = {} |
| (...skipping 19 matching lines...) Expand all Loading... |
| 372 if test_path is None: | 372 if test_path is None: |
| 373 continue | 373 continue |
| 374 test_dir = self.fs.dirname(test_path) | 374 test_dir = self.fs.dirname(test_path) |
| 375 if test_dir in directory_to_owner: | 375 if test_dir in directory_to_owner: |
| 376 email_addresses.add(directory_to_owner[test_dir]) | 376 email_addresses.add(directory_to_owner[test_dir]) |
| 377 return sorted(email_addresses) | 377 return sorted(email_addresses) |
| 378 | 378 |
| 379 def fetch_new_expectations_and_baselines(self): | 379 def fetch_new_expectations_and_baselines(self): |
| 380 """Adds new expectations and downloads baselines based on try job result
s, then commits and uploads the change.""" | 380 """Adds new expectations and downloads baselines based on try job result
s, then commits and uploads the change.""" |
| 381 _log.info('Adding test expectations lines to LayoutTests/TestExpectation
s.') | 381 _log.info('Adding test expectations lines to LayoutTests/TestExpectation
s.') |
| 382 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c
-test-expectations') | 382 script_path = self.path_from_blink_base('Tools', 'Scripts', 'update-w3c-
test-expectations') |
| 383 self.run([self.host.executable, script_path, '--verbose']) | 383 self.run([self.host.executable, script_path, '--verbose']) |
| 384 message = 'Modify TestExpectations or download new baselines for tests.' | 384 message = 'Modify TestExpectations or download new baselines for tests.' |
| 385 self.check_run(['git', 'commit', '-a', '-m', message]) | 385 self.check_run(['git', 'commit', '-a', '-m', message]) |
| 386 self.git_cl.run(['upload', '-m', message, '--rietveld']) | 386 self.git_cl.run(['upload', '-m', message, '--rietveld']) |
| 387 | 387 |
| 388 def update_all_test_expectations_files(self, deleted_tests, renamed_tests): | 388 def update_all_test_expectations_files(self, deleted_tests, renamed_tests): |
| 389 """Updates all test expectations files for tests that have been deleted
or renamed.""" | 389 """Updates all test expectations files for tests that have been deleted
or renamed.""" |
| 390 port = self.host.port_factory.get() | 390 port = self.host.port_factory.get() |
| 391 for path, file_contents in port.all_expectations_dict().iteritems(): | 391 for path, file_contents in port.all_expectations_dict().iteritems(): |
| 392 | 392 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 429 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
| 430 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 430 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
| 431 renamed_tests = {} | 431 renamed_tests = {} |
| 432 for line in out.splitlines(): | 432 for line in out.splitlines(): |
| 433 _, source_path, dest_path = line.split() | 433 _, source_path, dest_path = line.split() |
| 434 source_test = self.finder.layout_test_name(source_path) | 434 source_test = self.finder.layout_test_name(source_path) |
| 435 dest_test = self.finder.layout_test_name(dest_path) | 435 dest_test = self.finder.layout_test_name(dest_path) |
| 436 if source_test and dest_test: | 436 if source_test and dest_test: |
| 437 renamed_tests[source_test] = dest_test | 437 renamed_tests[source_test] = dest_test |
| 438 return renamed_tests | 438 return renamed_tests |
| OLD | NEW |