| 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 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 | |
| 23 from webkitpy.common.net.buildbot import current_build_link | 22 from webkitpy.common.net.buildbot import current_build_link |
| 23 from webkitpy.common.path_finder import PathFinder |
| 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.layout_tests.port.base import Port | 25 from webkitpy.layout_tests.port.base import Port |
| 26 from webkitpy.w3c.common import WPT_REPO_URL, WPT_DEST_NAME, exportable_commits_
since | 26 from webkitpy.w3c.common import WPT_REPO_URL, WPT_DEST_NAME, exportable_commits_
since |
| 27 from webkitpy.w3c.directory_owners_extractor import DirectoryOwnersExtractor | 27 from webkitpy.w3c.directory_owners_extractor import DirectoryOwnersExtractor |
| 28 from webkitpy.w3c.local_wpt import LocalWPT | 28 from webkitpy.w3c.local_wpt import LocalWPT |
| 29 from webkitpy.w3c.test_copier import TestCopier | 29 from webkitpy.w3c.test_copier import TestCopier |
| 30 from webkitpy.w3c.wpt_expectations_updater import WPTExpectationsUpdater | 30 from webkitpy.w3c.wpt_expectations_updater import WPTExpectationsUpdater |
| 31 from webkitpy.w3c.wpt_manifest import WPTManifest | 31 from webkitpy.w3c.wpt_manifest import WPTManifest |
| 32 | 32 |
| 33 # Settings for how often to check try job results and how long to wait. | 33 # Settings for how often to check try job results and how long to wait. |
| 34 POLL_DELAY_SECONDS = 2 * 60 | 34 POLL_DELAY_SECONDS = 2 * 60 |
| 35 TIMEOUT_SECONDS = 180 * 60 | 35 TIMEOUT_SECONDS = 180 * 60 |
| 36 | 36 |
| 37 _log = logging.getLogger(__file__) | 37 _log = logging.getLogger(__file__) |
| 38 | 38 |
| 39 | 39 |
| 40 class TestImporter(object): | 40 class TestImporter(object): |
| 41 | 41 |
| 42 def __init__(self, host): | 42 def __init__(self, host): |
| 43 self.host = host | 43 self.host = host |
| 44 self.executive = host.executive | 44 self.executive = host.executive |
| 45 self.fs = host.filesystem | 45 self.fs = host.filesystem |
| 46 self.finder = WebKitFinder(self.fs) | 46 self.finder = PathFinder(self.fs) |
| 47 self.verbose = False | 47 self.verbose = False |
| 48 self.git_cl = None | 48 self.git_cl = None |
| 49 | 49 |
| 50 def main(self, argv=None): | 50 def main(self, argv=None): |
| 51 options = self.parse_args(argv) | 51 options = self.parse_args(argv) |
| 52 self.verbose = options.verbose | 52 self.verbose = options.verbose |
| 53 log_level = logging.DEBUG if self.verbose else logging.INFO | 53 log_level = logging.DEBUG if self.verbose else logging.INFO |
| 54 logging.basicConfig(level=log_level, format='%(message)s') | 54 logging.basicConfig(level=log_level, format='%(message)s') |
| 55 | 55 |
| 56 if not self.checkout_is_okay(options.allow_local_commits): | 56 if not self.checkout_is_okay(options.allow_local_commits): |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" | 474 """Returns a dict mapping source to dest name for layout tests that have
been renamed.""" |
| 475 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) | 475 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff-
filter=R', '--name-status']) |
| 476 renamed_tests = {} | 476 renamed_tests = {} |
| 477 for line in out.splitlines(): | 477 for line in out.splitlines(): |
| 478 _, source_path, dest_path = line.split() | 478 _, source_path, dest_path = line.split() |
| 479 source_test = self.finder.layout_test_name(source_path) | 479 source_test = self.finder.layout_test_name(source_path) |
| 480 dest_test = self.finder.layout_test_name(dest_path) | 480 dest_test = self.finder.layout_test_name(dest_path) |
| 481 if source_test and dest_test: | 481 if source_test and dest_test: |
| 482 renamed_tests[source_test] = dest_test | 482 renamed_tests[source_test] = dest_test |
| 483 return renamed_tests | 483 return renamed_tests |
| OLD | NEW |