| 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 layout test expectations and baselines 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, 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 """ |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 If there are no failing results or no results could be fetched, | 95 If there are no failing results or no results could be fetched, |
| 96 this will return an empty dictionary. | 96 this will return an empty dictionary. |
| 97 """ | 97 """ |
| 98 layout_test_results = self.host.buildbot.fetch_results(build) | 98 layout_test_results = self.host.buildbot.fetch_results(build) |
| 99 if layout_test_results is None: | 99 if layout_test_results is None: |
| 100 _log.warning('No results for build %s', build) | 100 _log.warning('No results for build %s', build) |
| 101 return {} | 101 return {} |
| 102 port_name = self.host.builders.port_name_for_builder_name(build.builder_
name) | 102 port_name = self.host.builders.port_name_for_builder_name(build.builder_
name) |
| 103 test_results = layout_test_results.didnt_run_as_expected_results() | 103 test_results = [result for result in layout_test_results.didnt_run_as_ex
pected_results() if not result.did_pass()] |
| 104 failing_results_dict = self.generate_results_dict(port_name, test_result
s) | 104 failing_results_dict = self.generate_results_dict(port_name, test_result
s) |
| 105 return failing_results_dict | 105 return failing_results_dict |
| 106 | 106 |
| 107 def generate_results_dict(self, full_port_name, test_results): | 107 def generate_results_dict(self, full_port_name, test_results): |
| 108 """Makes a dict with results for one platform. | 108 """Makes a dict with results for one platform. |
| 109 | 109 |
| 110 Args: | 110 Args: |
| 111 full_port_name: The fully-qualified port name, e.g. "win-win10". | 111 full_port_name: The fully-qualified port name, e.g. "win-win10". |
| 112 test_results: A list of LayoutTestResult objects. | 112 test_results: A list of LayoutTestResult objects. |
| 113 | 113 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 This might correspond to a deleted file or a non-test. | 438 This might correspond to a deleted file or a non-test. |
| 439 """ | 439 """ |
| 440 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 440 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
| 441 test_parser = TestParser(absolute_path, self.host) | 441 test_parser = TestParser(absolute_path, self.host) |
| 442 if not test_parser.test_doc: | 442 if not test_parser.test_doc: |
| 443 return False | 443 return False |
| 444 return test_parser.is_jstest() | 444 return test_parser.is_jstest() |
| 445 | 445 |
| 446 def _get_try_bots(self): | 446 def _get_try_bots(self): |
| 447 return self.host.builders.all_try_builder_names() | 447 return self.host.builders.all_try_builder_names() |
| OLD | NEW |