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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 | 622 |
| 623 if self.m.filter.matches_exclusion: | 623 if self.m.filter.matches_exclusion: |
| 624 requires_compile = bool(exes or compile_targets) | 624 requires_compile = bool(exes or compile_targets) |
| 625 return requires_compile, exes, compile_targets | 625 return requires_compile, exes, compile_targets |
| 626 | 626 |
| 627 if not self.m.filter.result: | 627 if not self.m.filter.result: |
| 628 # Patch does not require compile. | 628 # Patch does not require compile. |
| 629 return False, [], [] | 629 return False, [], [] |
| 630 | 630 |
| 631 compile_targets = self.m.filter.compile_targets | 631 compile_targets = self.m.filter.compile_targets |
| 632 matching_exes = self.m.filter.matching_exes | |
|
Dirk Pranke
2015/10/20 20:08:31
Why keep both compile_targets and matching_exes? W
Dirk Pranke
2015/10/20 20:10:06
(as noted in the other comment)
| |
| 632 | 633 |
| 633 # Add crash_service to compile_targets. This is done after filtering compile | 634 # Add crash_service to compile_targets. This is done after filtering compile |
| 634 # targets out because crash_service should always be there on windows. | 635 # targets out because crash_service should always be there on windows. |
| 635 # TODO(akuegel): Need to solve this in a better way. crbug.com/478053 | 636 # TODO(akuegel): Need to solve this in a better way. crbug.com/478053 |
| 636 if (self.m.platform.is_win and compile_targets and | 637 if (self.m.platform.is_win and compile_targets and |
| 637 'crash_service' not in compile_targets): | 638 'crash_service' not in compile_targets): |
| 638 compile_targets.extend(['crash_service']) | 639 compile_targets.extend(['crash_service']) |
| 640 matching_exes.extend(['crash_service']) | |
| 639 | 641 |
| 640 # Emit more detailed output useful for debugging. | 642 # Emit more detailed output useful for debugging. |
| 641 analyze_details = { | 643 analyze_details = { |
| 642 'original_exes': original_exes, | 644 'original_exes': original_exes, |
| 643 'original_compile_targets': original_compile_targets, | 645 'original_compile_targets': original_compile_targets, |
| 644 'compile_targets': compile_targets, | 646 'compile_targets': compile_targets, |
| 647 'matching_exes': matching_exes, | |
| 645 'self.m.filter.compile_targets': self.m.filter.compile_targets, | 648 'self.m.filter.compile_targets': self.m.filter.compile_targets, |
| 646 'self.m.filter.matching_exes': self.m.filter.matching_exes, | 649 'self.m.filter.matching_exes': self.m.filter.matching_exes, |
| 647 } | 650 } |
| 648 with contextlib.closing(recipe_util.StringListIO()) as listio: | 651 with contextlib.closing(recipe_util.StringListIO()) as listio: |
| 649 json.dump(analyze_details, listio, indent=2, sort_keys=True) | 652 json.dump(analyze_details, listio, indent=2, sort_keys=True) |
| 650 step_result = self.m.step.active_result | 653 step_result = self.m.step.active_result |
| 651 step_result.presentation.logs['analyze_details'] = listio.lines | 654 step_result.presentation.logs['analyze_details'] = listio.lines |
| 652 | 655 |
| 653 # Note: due to our custom logic above it's possible we end up with empty | 656 # Note: due to our custom logic above it's possible we end up with empty |
| 654 # results. In this case we should not compile, because doing so would | 657 # results. In this case we should not compile, because doing so would |
| 655 # use default compile targets (i.e. compile too much). | 658 # use default compile targets (i.e. compile too much). |
| 656 requires_compile = bool(self.m.filter.matching_exes or compile_targets) | 659 requires_compile = bool(matching_exes or compile_targets) |
| 657 return requires_compile, self.m.filter.matching_exes, compile_targets | 660 return requires_compile, matching_exes, compile_targets |
| 658 | 661 |
| 659 def configure_swarming(self, project_name, precommit, mastername=None): | 662 def configure_swarming(self, project_name, precommit, mastername=None): |
| 660 """Configures default swarming dimensions and tags. | 663 """Configures default swarming dimensions and tags. |
| 661 | 664 |
| 662 Args: | 665 Args: |
| 663 project_name: Lowercase name of the project, e.g. "blink", "chromium". | 666 project_name: Lowercase name of the project, e.g. "blink", "chromium". |
| 664 precommit: Boolean flag to indicate whether the tests are running before | 667 precommit: Boolean flag to indicate whether the tests are running before |
| 665 the changes are commited. | 668 the changes are commited. |
| 666 """ | 669 """ |
| 667 self.m.swarming.set_default_dimension('pool', 'Chrome') | 670 self.m.swarming.set_default_dimension('pool', 'Chrome') |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 793 result_text = 'MB is enabled for this builder at this revision.' | 796 result_text = 'MB is enabled for this builder at this revision.' |
| 794 log_name = 'Builder MB-ready' | 797 log_name = 'Builder MB-ready' |
| 795 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 798 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 796 return False | 799 return False |
| 797 except (self.m.step.StepFailure, KeyError): | 800 except (self.m.step.StepFailure, KeyError): |
| 798 result_text = 'MB is not enabled for this builder at this revision.' | 801 result_text = 'MB is not enabled for this builder at this revision.' |
| 799 log_name = 'Builder NOT MB-ready' | 802 log_name = 'Builder NOT MB-ready' |
| 800 self.m.step.active_result.presentation.logs[log_name] = [result_text] | 803 self.m.step.active_result.presentation.logs[log_name] = [result_text] |
| 801 self.m.step.active_result.presentation.status = self.m.step.WARNING | 804 self.m.step.active_result.presentation.status = self.m.step.WARNING |
| 802 return True | 805 return True |
| OLD | NEW |