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 """A class for updating layout test expectations 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, and: |
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. |
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 |
(...skipping 26 matching lines...) Expand all Loading... |
37 args = parser.parse_args(args) | 37 args = parser.parse_args(args) |
38 log_level = logging.DEBUG if args.verbose else logging.INFO | 38 log_level = logging.DEBUG if args.verbose else logging.INFO |
39 logging.basicConfig(level=log_level, format='%(message)s') | 39 logging.basicConfig(level=log_level, format='%(message)s') |
40 | 40 |
41 issue_number = self.get_issue_number() | 41 issue_number = self.get_issue_number() |
42 if issue_number == 'None': | 42 if issue_number == 'None': |
43 _log.error('No issue on current branch.') | 43 _log.error('No issue on current branch.') |
44 return 1 | 44 return 1 |
45 | 45 |
46 rietveld = Rietveld(self.host.web) | 46 rietveld = Rietveld(self.host.web) |
47 builds = rietveld.latest_try_job_results(issue_number, self.get_try_bots
()) | 47 builds = rietveld.latest_try_jobs(issue_number, self.get_try_bots()) |
48 _log.debug('Latest try jobs: %r', builds) | 48 _log.debug('Latest try jobs: %r', builds) |
49 | 49 |
50 if not builds: | 50 if not builds: |
51 _log.error('No try job information was collected.') | 51 _log.error('No try job information was collected.') |
52 return 1 | 52 return 1 |
53 | 53 |
54 test_expectations = {} | 54 test_expectations = {} |
55 for build in builds: | 55 for build in builds: |
56 platform_results = self.get_failing_results_dict(build) | 56 platform_results = self.get_failing_results_dict(build) |
57 test_expectations = self.merge_dicts(test_expectations, platform_res
ults) | 57 test_expectations = self.merge_dicts(test_expectations, platform_res
ults) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 Args: | 368 Args: |
369 test_path: A file path relative to the layout tests directory. | 369 test_path: A file path relative to the layout tests directory. |
370 This might correspond to a deleted file or a non-test. | 370 This might correspond to a deleted file or a non-test. |
371 """ | 371 """ |
372 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 372 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
373 test_parser = TestParser(absolute_path, self.host) | 373 test_parser = TestParser(absolute_path, self.host) |
374 if not test_parser.test_doc: | 374 if not test_parser.test_doc: |
375 return False | 375 return False |
376 return test_parser.is_jstest() | 376 return test_parser.is_jstest() |
OLD | NEW |