Chromium Code Reviews| 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 contextlib | 6 import contextlib |
| 7 import copy | 7 import copy |
| 8 import itertools | 8 import itertools |
| 9 import json | 9 import json |
| 10 | 10 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 mode='dev' | 464 mode='dev' |
| 465 ) | 465 ) |
| 466 | 466 |
| 467 def run_mb_and_compile(self, compile_targets, isolated_targets, name_suffix): | 467 def run_mb_and_compile(self, compile_targets, isolated_targets, name_suffix): |
| 468 if self.m.chromium.c.project_generator.tool == 'mb': | 468 if self.m.chromium.c.project_generator.tool == 'mb': |
| 469 # We don't use the mastername and buildername passed in, because | 469 # We don't use the mastername and buildername passed in, because |
| 470 # those may be the values of the continuous builder the trybot may | 470 # those may be the values of the continuous builder the trybot may |
| 471 # be configured to match; we need to use the actual mastername | 471 # be configured to match; we need to use the actual mastername |
| 472 # and buildername we're running on, because it may be configured | 472 # and buildername we're running on, because it may be configured |
| 473 # with different MB settings. | 473 # with different MB settings. |
| 474 real_mastername = self.m.properties['mastername'] | 474 # However, use target_mastername and target_buildername instead if they |
| 475 real_buildername = self.m.properties['buildername'] | 475 # are available in the build properties. This gives a recipe running on a |
| 476 self.m.chromium.run_mb(real_mastername, real_buildername, | 476 # trybot the flexibility to run MB in exactly the same configuration as |
| 477 # the continuous builder it tries to match. | |
| 478 target_mastername = self.m.properties.get('target_mastername') or \ | |
| 479 self.m.properties['mastername'] | |
| 480 target_buildername = self.m.properties.get('target_buildername') or \ | |
| 481 self.m.properties['buildername'] | |
|
Dirk Pranke
2015/11/17 22:38:51
nit: wrap the expression in parentheses instead of
stgao
2015/11/19 22:06:33
Done.
| |
| 482 self.m.chromium.run_mb(target_mastername, target_buildername, | |
| 477 isolated_targets=isolated_targets, | 483 isolated_targets=isolated_targets, |
| 478 name='generate_build_files%s' % name_suffix) | 484 name='generate_build_files%s' % name_suffix) |
| 479 | 485 |
| 480 self.m.chromium.compile(compile_targets, name='compile%s' % name_suffix) | 486 self.m.chromium.compile(compile_targets, name='compile%s' % name_suffix) |
| 481 | 487 |
| 482 def tests_for_builder(self, mastername, buildername, update_step, master_dict, | 488 def tests_for_builder(self, mastername, buildername, update_step, master_dict, |
| 483 override_bot_type=None): | 489 override_bot_type=None): |
| 484 got_revision = update_step.presentation.properties['got_revision'] | 490 got_revision = update_step.presentation.properties['got_revision'] |
| 485 | 491 |
| 486 bot_config = master_dict.get('builders', {}).get(buildername) | 492 bot_config = master_dict.get('builders', {}).get(buildername) |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 result_text = 'MB is enabled for this builder at this revision.' | 833 result_text = 'MB is enabled for this builder at this revision.' |
| 828 log_name = 'Builder MB-ready' | 834 log_name = 'Builder MB-ready' |
| 829 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 835 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 830 return False | 836 return False |
| 831 except (self.m.step.StepFailure, KeyError): | 837 except (self.m.step.StepFailure, KeyError): |
| 832 result_text = 'MB is not enabled for this builder at this revision.' | 838 result_text = 'MB is not enabled for this builder at this revision.' |
| 833 log_name = 'Builder NOT MB-ready' | 839 log_name = 'Builder NOT MB-ready' |
| 834 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 840 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 835 self.m.step.active_result.presentation.status = self.m.step.WARNING | 841 self.m.step.active_result.presentation.status = self.m.step.WARNING |
| 836 return True | 842 return True |
| OLD | NEW |