Chromium Code Reviews| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 if self.fs.exists(self.path_from_webkit_base(WPT_DEST_NAME)): | 95 if self.fs.exists(self.path_from_webkit_base(WPT_DEST_NAME)): |
| 96 self.print_('## WebKit/%s exists; aborting.' % WPT_DEST_NAME) | 96 self.print_('## WebKit/%s exists; aborting.' % WPT_DEST_NAME) |
| 97 return False | 97 return False |
| 98 | 98 |
| 99 if self.fs.exists(self.path_from_webkit_base(CSS_DEST_NAME)): | 99 if self.fs.exists(self.path_from_webkit_base(CSS_DEST_NAME)): |
| 100 self.print_('## WebKit/%s repo exists; aborting.' % CSS_DEST_NAME) | 100 self.print_('## WebKit/%s repo exists; aborting.' % CSS_DEST_NAME) |
| 101 return False | 101 return False |
| 102 | 102 |
| 103 return True | 103 return True |
| 104 | 104 |
| 105 def _copy_resources_to_wpt(self): | 105 def _copy_resources(self): |
| 106 """Copies some files over to a newly-updated wpt directory. | 106 """Copies resources from LayoutTests/resources to wpt and vice versa. |
| 107 | 107 |
| 108 There are some resources in our repository that we use instead of the | 108 There are some common resources that have copies in web-platform-tests, |
| 109 upstream versions. | 109 and for some we always want to use the upstream versions, but for others |
| 110 we always want to use our version, so these are copied after import to | |
|
jsbell
2016/09/01 17:55:55
nit: run-on sentence; can you split it up?
qyearsley
2016/09/01 18:16:24
Done; also I think the comments below are redundan
| |
| 111 ensure consistency. | |
| 112 | |
| 113 If this method is changed, the lists of files expected to be identical | |
| 114 in LayoutTests/PRESUBMIT.py should also be cahnged. | |
|
jsbell
2016/09/01 17:55:55
typo: "cahnged" -> "changed"
qyearsley
2016/09/01 18:16:24
Done
| |
| 110 """ | 115 """ |
| 111 resources_to_copy = [ | 116 # There are some resources in our repository that we use instead of the |
| 117 # upstream versions. | |
|
jsbell
2016/09/01 17:55:55
Can drop "There are some"
But maybe document why
qyearsley
2016/09/01 18:16:24
I'm actually not sure except for testharnessreport
| |
| 118 resources_to_copy_to_wpt = [ | |
| 112 ('testharnessreport.js', 'resources'), | 119 ('testharnessreport.js', 'resources'), |
| 113 ('WebIDLParser.js', 'resources'), | 120 ('WebIDLParser.js', 'resources'), |
|
jsbell
2016/09/01 17:55:55
Why do we want our WebIDLParser.js instead of wpt'
qyearsley
2016/09/01 18:16:25
Not sure; added a TODO.
| |
| 114 ('vendor-prefix.js', 'common'), | 121 ('vendor-prefix.js', 'common'), |
| 115 ] | 122 ] |
| 116 for filename, wpt_subdir in resources_to_copy: | 123 for filename, wpt_subdir in resources_to_copy_to_wpt: |
| 117 source = self.path_from_webkit_base('LayoutTests', 'resources', file name) | 124 source = self.path_from_webkit_base('LayoutTests', 'resources', file name) |
| 118 destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, wpt_subdir, filename) | 125 destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, wpt_subdir, filename) |
| 119 self.copyfile(source, destination) | 126 self.copyfile(source, destination) |
| 120 self.run(['git', 'add', destination]) | 127 self.run(['git', 'add', destination]) |
| 121 | 128 |
| 129 # There are also some resources from the upstream repository that | |
|
jsbell
2016/09/01 17:55:55
Maybe move this list up near the other one near th
qyearsley
2016/09/01 18:16:25
Done
| |
| 130 # we copy over to LayoutTests/resources which we may want to update. | |
| 131 resources_to_copy_from_wpt = [ | |
|
jsbell
2016/09/01 17:55:55
As above, can we document why we want wpt's versio
qyearsley
2016/09/01 18:16:24
Again, not completely sure :-/
| |
| 132 ('idlharness.js', 'resources'), | |
| 133 ('testharness.js', 'resources'), | |
| 134 ] | |
| 135 for filename, wpt_subdir in resources_to_copy_from_wpt: | |
| 136 source = self.path_from_webkit_base('LayoutTests', 'imported', WPT_D EST_NAME, wpt_subdir, filename) | |
| 137 destination = self.path_from_webkit_base('LayoutTests', 'resources', filename) | |
| 138 self.copyfile(source, destination) | |
| 139 self.run(['git', 'add', destination]) | |
| 140 | |
| 122 def update(self, dest_dir_name, url, keep_w3c_repos_around): | 141 def update(self, dest_dir_name, url, keep_w3c_repos_around): |
| 123 """Updates an imported repository. | 142 """Updates an imported repository. |
| 124 | 143 |
| 125 Args: | 144 Args: |
| 126 dest_dir_name: The destination directory name. | 145 dest_dir_name: The destination directory name. |
| 127 url: URL of the git repository. | 146 url: URL of the git repository. |
| 128 | 147 |
| 129 Returns: | 148 Returns: |
| 130 A string for the commit description "<destination>@<commitish>". | 149 A string for the commit description "<destination>@<commitish>". |
| 131 """ | 150 """ |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 email_addresses.add(directory_to_owner[test_dir]) | 351 email_addresses.add(directory_to_owner[test_dir]) |
| 333 return sorted(email_addresses) | 352 return sorted(email_addresses) |
| 334 | 353 |
| 335 def write_test_expectations(self): | 354 def write_test_expectations(self): |
| 336 self.print_('## Adding test expectations lines to LayoutTests/TestExpect ations.') | 355 self.print_('## Adding test expectations lines to LayoutTests/TestExpect ations.') |
| 337 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c -test-expectations') | 356 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c -test-expectations') |
| 338 self.run([self.host.executable, script_path]) | 357 self.run([self.host.executable, script_path]) |
| 339 message = '\'Modifies TestExpectations and/or downloads new baselines fo r tests\'' | 358 message = '\'Modifies TestExpectations and/or downloads new baselines fo r tests\'' |
| 340 self.check_run(['git', 'commit', '-a', '-m', message]) | 359 self.check_run(['git', 'commit', '-a', '-m', message]) |
| 341 self.git_cl(['upload', '-m', message, '--rietveld']) | 360 self.git_cl(['upload', '-m', message, '--rietveld']) |
| OLD | NEW |