| 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 """A class for updating layout test expectations when updating w3c tests. | 5 """Updates layout test expectations and baselines when updating w3c tests. |
| 6 | 6 |
| 7 Specifically, this class fetches results from try bots for the current CL, and: | 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. | 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 | |
| 11 This is used as part of the w3c test auto-import process. | |
| 12 """ | 10 """ |
| 13 | 11 |
| 14 import argparse | 12 import argparse |
| 15 import copy | 13 import copy |
| 16 import logging | 14 import logging |
| 17 | 15 |
| 18 from webkitpy.common.net.git_cl import GitCL | 16 from webkitpy.common.net.git_cl import GitCL |
| 19 from webkitpy.common.net.rietveld import Rietveld | 17 from webkitpy.common.net.rietveld import Rietveld |
| 20 from webkitpy.common.webkit_finder import WebKitFinder | 18 from webkitpy.common.webkit_finder import WebKitFinder |
| 21 from webkitpy.layout_tests.models.test_expectations import TestExpectationLine | 19 from webkitpy.layout_tests.models.test_expectations import TestExpectationLine |
| 22 from webkitpy.w3c.test_parser import TestParser | 20 from webkitpy.w3c.test_parser import TestParser |
| 23 | 21 |
| 24 _log = logging.getLogger(__name__) | 22 _log = logging.getLogger(__name__) |
| 25 | 23 |
| 26 MARKER_COMMENT = '# ====== New tests from w3c-test-autoroller added here ======' | 24 MARKER_COMMENT = '# ====== New tests from w3c-test-autoroller added here ======' |
| 27 | 25 |
| 28 | 26 |
| 29 class W3CExpectationsLineAdder(object): | 27 class WPTExpectationsUpdater(object): |
| 30 | 28 |
| 31 def __init__(self, host): | 29 def __init__(self, host): |
| 32 self.host = host | 30 self.host = host |
| 33 self.host.initialize_scm() | 31 self.host.initialize_scm() |
| 34 self.finder = WebKitFinder(self.host.filesystem) | 32 self.finder = WebKitFinder(self.host.filesystem) |
| 35 | 33 |
| 36 def run(self, args=None): | 34 def run(self, args=None): |
| 37 """Downloads text new baselines and adds test expectations lines.""" | 35 """Downloads text new baselines and adds test expectations lines.""" |
| 38 parser = argparse.ArgumentParser(description=__doc__) | 36 parser = argparse.ArgumentParser(description=__doc__) |
| 39 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') | 37 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 377 |
| 380 Args: | 378 Args: |
| 381 test_path: A file path relative to the layout tests directory. | 379 test_path: A file path relative to the layout tests directory. |
| 382 This might correspond to a deleted file or a non-test. | 380 This might correspond to a deleted file or a non-test. |
| 383 """ | 381 """ |
| 384 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 382 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
| 385 test_parser = TestParser(absolute_path, self.host) | 383 test_parser = TestParser(absolute_path, self.host) |
| 386 if not test_parser.test_doc: | 384 if not test_parser.test_doc: |
| 387 return False | 385 return False |
| 388 return test_parser.is_jstest() | 386 return test_parser.is_jstest() |
| OLD | NEW |