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: | 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 logging | |
| 19 import argparse | 18 import argparse |
| 20 import json | 19 import json |
| 20 import logging | |
| 21 import re | |
| 21 | 22 |
| 22 from webkitpy.common.net.git_cl import GitCL | 23 from webkitpy.common.net.git_cl import GitCL |
| 23 from webkitpy.common.webkit_finder import WebKitFinder | 24 from webkitpy.common.webkit_finder import WebKitFinder |
| 24 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes tExpectationParser | 25 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes tExpectationParser |
| 25 from webkitpy.w3c.test_importer import TestImporter | 26 from webkitpy.w3c.test_importer import TestImporter |
| 26 from webkitpy.w3c.common import WPT_REPO_URL, CSS_REPO_URL, WPT_DEST_NAME, CSS_D EST_NAME | 27 from webkitpy.w3c.common import WPT_REPO_URL, CSS_REPO_URL, WPT_DEST_NAME, CSS_D EST_NAME |
| 27 | 28 |
| 28 # Settings for how often to check try job results and how long to wait. | 29 # Settings for how often to check try job results and how long to wait. |
| 29 POLL_DELAY_SECONDS = 2 * 60 | 30 POLL_DELAY_SECONDS = 2 * 60 |
| 30 TIMEOUT_SECONDS = 180 * 60 | 31 TIMEOUT_SECONDS = 180 * 60 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 Returns: | 383 Returns: |
| 383 A list of the email addresses to be notified for the current import. | 384 A list of the email addresses to be notified for the current import. |
| 384 """ | 385 """ |
| 385 email_addresses = set() | 386 email_addresses = set() |
| 386 for file_path in changed_files: | 387 for file_path in changed_files: |
| 387 test_path = self.finder.layout_test_name(file_path) | 388 test_path = self.finder.layout_test_name(file_path) |
| 388 if test_path is None: | 389 if test_path is None: |
| 389 continue | 390 continue |
| 390 test_dir = self.fs.dirname(test_path) | 391 test_dir = self.fs.dirname(test_path) |
| 391 if test_dir in directory_to_owner: | 392 if test_dir in directory_to_owner: |
| 392 email_addresses.add(directory_to_owner[test_dir]) | 393 address = directory_to_owner[test_dir] |
| 394 if not re.match(r'\S+@\S+', address): | |
|
jeffcarp
2017/01/23 20:28:34
I read somewhere that '@' isn't necessarily requir
| |
| 395 _log.warning('%s appears not be an email address, skipping.' , address) | |
| 396 continue | |
| 397 email_addresses.add(address) | |
| 393 return sorted(email_addresses) | 398 return sorted(email_addresses) |
| 394 | 399 |
| 395 def fetch_new_expectations_and_baselines(self): | 400 def fetch_new_expectations_and_baselines(self): |
| 396 """Adds new expectations and downloads baselines based on try job result s, then commits and uploads the change.""" | 401 """Adds new expectations and downloads baselines based on try job result s, then commits and uploads the change.""" |
| 397 _log.info('Adding test expectations lines to LayoutTests/TestExpectation s.') | 402 _log.info('Adding test expectations lines to LayoutTests/TestExpectation s.') |
| 398 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c -test-expectations') | 403 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c -test-expectations') |
| 399 self.run([self.host.executable, script_path, '--verbose']) | 404 self.run([self.host.executable, script_path, '--verbose']) |
| 400 message = 'Modify TestExpectations or download new baselines for tests.' | 405 message = 'Modify TestExpectations or download new baselines for tests.' |
| 401 self.check_run(['git', 'commit', '-a', '-m', message]) | 406 self.check_run(['git', 'commit', '-a', '-m', message]) |
| 402 self.git_cl.run(['upload', '-m', message, '--rietveld']) | 407 self.git_cl.run(['upload', '-m', message, '--rietveld']) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 """Returns a dict mapping source to dest name for layout tests that have been renamed.""" | 450 """Returns a dict mapping source to dest name for layout tests that have been renamed.""" |
| 446 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status']) | 451 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status']) |
| 447 renamed_tests = {} | 452 renamed_tests = {} |
| 448 for line in out.splitlines(): | 453 for line in out.splitlines(): |
| 449 _, source_path, dest_path = line.split() | 454 _, source_path, dest_path = line.split() |
| 450 source_test = self.finder.layout_test_name(source_path) | 455 source_test = self.finder.layout_test_name(source_path) |
| 451 dest_test = self.finder.layout_test_name(dest_path) | 456 dest_test = self.finder.layout_test_name(dest_path) |
| 452 if source_test and dest_test: | 457 if source_test and dest_test: |
| 453 renamed_tests[source_test] = dest_test | 458 renamed_tests[source_test] = dest_test |
| 454 return renamed_tests | 459 return renamed_tests |
| OLD | NEW |