| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 """Updates expectations and baselines when updating web-platform-tests. | 5 """Updates expectations and baselines when updating web-platform-tests. |
| 6 | 6 |
| 7 Specifically, this class fetches results from try bots for the current CL, then | 7 Specifically, this class fetches results from try bots for the current CL, then |
| 8 (1) downloads new baseline files for any tests that can be rebaselined, and | 8 (1) downloads new baseline files for any tests that can be rebaselined, and |
| 9 (2) updates the generic TestExpectations file for any other failing tests. | 9 (2) updates the generic TestExpectations file for any other failing tests. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import argparse | 12 import argparse |
| 13 import copy | 13 import copy |
| 14 import logging | 14 import logging |
| 15 | 15 |
| 16 from webkitpy.common.memoized import memoized | 16 from webkitpy.common.memoized import memoized |
| 17 from webkitpy.common.net.git_cl import GitCL | 17 from webkitpy.common.net.git_cl import GitCL |
| 18 from webkitpy.common.webkit_finder import WebKitFinder | 18 from webkitpy.common.path_finder import PathFinder |
| 19 from webkitpy.layout_tests.models.test_expectations import TestExpectationLine,
TestExpectations | 19 from webkitpy.layout_tests.models.test_expectations import TestExpectationLine,
TestExpectations |
| 20 from webkitpy.w3c.wpt_manifest import WPTManifest | 20 from webkitpy.w3c.wpt_manifest import WPTManifest |
| 21 | 21 |
| 22 _log = logging.getLogger(__name__) | 22 _log = logging.getLogger(__name__) |
| 23 | 23 |
| 24 MARKER_COMMENT = '# ====== New tests from wpt-importer added here ======' | 24 MARKER_COMMENT = '# ====== New tests from wpt-importer added here ======' |
| 25 | 25 |
| 26 | 26 |
| 27 class WPTExpectationsUpdater(object): | 27 class WPTExpectationsUpdater(object): |
| 28 | 28 |
| 29 def __init__(self, host): | 29 def __init__(self, host): |
| 30 self.host = host | 30 self.host = host |
| 31 self.port = self.host.port_factory.get() | 31 self.port = self.host.port_factory.get() |
| 32 self.finder = WebKitFinder(self.host.filesystem) | 32 self.finder = PathFinder(self.host.filesystem) |
| 33 self.port = self.host.port_factory.get() | 33 self.port = self.host.port_factory.get() |
| 34 | 34 |
| 35 def run(self, args=None): | 35 def run(self, args=None): |
| 36 """Downloads text new baselines and adds test expectations lines.""" | 36 """Downloads text new baselines and adds test expectations lines.""" |
| 37 parser = argparse.ArgumentParser(description=__doc__) | 37 parser = argparse.ArgumentParser(description=__doc__) |
| 38 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') | 38 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') |
| 39 args = parser.parse_args(args) | 39 args = parser.parse_args(args) |
| 40 | 40 |
| 41 log_level = logging.DEBUG if args.verbose else logging.INFO | 41 log_level = logging.DEBUG if args.verbose else logging.INFO |
| 42 logging.basicConfig(level=log_level, format='%(message)s') | 42 logging.basicConfig(level=log_level, format='%(message)s') |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 if result['actual'] in ('CRASH', 'TIMEOUT', 'MISSING'): | 446 if result['actual'] in ('CRASH', 'TIMEOUT', 'MISSING'): |
| 447 return False | 447 return False |
| 448 return True | 448 return True |
| 449 | 449 |
| 450 def is_reference_test(self, test_path): | 450 def is_reference_test(self, test_path): |
| 451 """Checks whether a given file is a testharness.js test.""" | 451 """Checks whether a given file is a testharness.js test.""" |
| 452 return bool(self.port.reference_files(test_path)) | 452 return bool(self.port.reference_files(test_path)) |
| 453 | 453 |
| 454 def _get_try_bots(self): | 454 def _get_try_bots(self): |
| 455 return self.host.builders.all_try_builder_names() | 455 return self.host.builders.all_try_builder_names() |
| OLD | NEW |