| 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 import ast | 5 import ast |
| 6 import collections | 6 import collections |
| 7 import contextlib | 7 import contextlib |
| 8 import copy | 8 import copy |
| 9 import itertools | 9 import itertools |
| 10 import json | 10 import json |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 except self.m.step.StepFailure: | 175 except self.m.step.StepFailure: |
| 176 # As part of deapplying patch we call runhooks without the patch. | 176 # As part of deapplying patch we call runhooks without the patch. |
| 177 self.deapply_patch(update_step) | 177 self.deapply_patch(update_step) |
| 178 raise | 178 raise |
| 179 else: | 179 else: |
| 180 self.m.chromium.runhooks() | 180 self.m.chromium.runhooks() |
| 181 | 181 |
| 182 def get_test_spec(self, mastername, buildername): | 182 def get_test_spec(self, mastername, buildername): |
| 183 bot_config = self._get_bot_config(mastername, buildername) | 183 bot_config = self._get_bot_config(mastername, buildername) |
| 184 | 184 |
| 185 # The official builders specify the test spec using a test_spec property in |
| 186 # the bot_config instead of reading it from a file. |
| 187 if 'test_spec' in bot_config: |
| 188 return { buildername: bot_config['test_spec'] } |
| 189 |
| 185 test_spec_file = bot_config.get('testing', {}).get( | 190 test_spec_file = bot_config.get('testing', {}).get( |
| 186 'test_spec_file', '%s.json' % mastername) | 191 'test_spec_file', '%s.json' % mastername) |
| 187 | 192 |
| 188 # TODO(phajdan.jr): Bots should have no generators instead. | 193 # TODO(phajdan.jr): Bots should have no generators instead. |
| 189 if bot_config.get('disable_tests'): | 194 if bot_config.get('disable_tests'): |
| 190 return {} | 195 return {} |
| 191 return self.read_test_spec(self.m, test_spec_file) | 196 return self.read_test_spec(self.m, test_spec_file) |
| 192 | 197 |
| 193 def _get_master_dict_with_dynamic_tests( | 198 def _get_master_dict_with_dynamic_tests( |
| 194 self, mastername, buildername, test_spec, scripts_compile_targets): | 199 self, mastername, buildername, test_spec, scripts_compile_targets): |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 result_text = 'MB is enabled for this builder at this revision.' | 898 result_text = 'MB is enabled for this builder at this revision.' |
| 894 log_name = 'Builder MB-ready' | 899 log_name = 'Builder MB-ready' |
| 895 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 900 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 896 return False | 901 return False |
| 897 except (self.m.step.StepFailure, KeyError): | 902 except (self.m.step.StepFailure, KeyError): |
| 898 result_text = 'MB is not enabled for this builder at this revision.' | 903 result_text = 'MB is not enabled for this builder at this revision.' |
| 899 log_name = 'Builder NOT MB-ready' | 904 log_name = 'Builder NOT MB-ready' |
| 900 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 905 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 901 self.m.step.active_result.presentation.status = self.m.step.WARNING | 906 self.m.step.active_result.presentation.status = self.m.step.WARNING |
| 902 return True | 907 return True |
| OLD | NEW |