OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 re | 5 import re |
6 | 6 |
7 from slave import recipe_api | 7 from slave import recipe_api |
8 from slave import recipe_util | 8 from slave import recipe_util |
9 | 9 |
10 from . import builders | 10 from . import builders |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 args.extend(['--build-config-fs', self.c.build_config_fs]) | 697 args.extend(['--build-config-fs', self.c.build_config_fs]) |
698 | 698 |
699 paths = {} | 699 paths = {} |
700 for path in ('build', 'checkout'): | 700 for path in ('build', 'checkout'): |
701 paths[path] = self.m.path[path] | 701 paths[path] = self.m.path[path] |
702 args.extend(['--paths', self.m.json.input(paths)]) | 702 args.extend(['--paths', self.m.json.input(paths)]) |
703 | 703 |
704 properties = {} | 704 properties = {} |
705 # TODO(phajdan.jr): Remove buildnumber when no longer used. | 705 # TODO(phajdan.jr): Remove buildnumber when no longer used. |
706 for name in ('buildername', 'slavename', 'buildnumber'): | 706 |
| 707 mastername = self.m.properties.get('mastername') |
| 708 buildername = self.m.properties.get('buildername') |
| 709 master_dict = self.builders.get(mastername, {}) |
| 710 bot_config = master_dict.get('builders', {}).get(buildername, {}) |
| 711 |
| 712 for name in ('buildername', 'slavename', 'buildnumber', 'mastername'): |
707 properties[name] = self.m.properties[name] | 713 properties[name] = self.m.properties[name] |
| 714 |
| 715 # Optional properties |
| 716 for name in ('perf-id', 'results-url'): |
| 717 if bot_config.get(name): |
| 718 properties[name] = bot_config[name] |
| 719 |
| 720 properties['target_platform'] = self.c.TARGET_PLATFORM |
| 721 |
708 args.extend(['--properties', self.m.json.input(properties)]) | 722 args.extend(['--properties', self.m.json.input(properties)]) |
709 | 723 |
710 return args | 724 return args |
711 | 725 |
712 def get_compile_targets_for_scripts(self): | 726 def get_compile_targets_for_scripts(self): |
713 return self.m.python( | 727 return self.m.python( |
714 name='get compile targets for scripts', | 728 name='get compile targets for scripts', |
715 script=self.m.path['checkout'].join( | 729 script=self.m.path['checkout'].join( |
716 'testing', 'scripts', 'get_compile_targets.py'), | 730 'testing', 'scripts', 'get_compile_targets.py'), |
717 args=[ | 731 args=[ |
718 '--output', self.m.json.output(), | 732 '--output', self.m.json.output(), |
719 '--', | 733 '--', |
720 ] + self.get_common_args_for_scripts(), | 734 ] + self.get_common_args_for_scripts(), |
721 step_test_data=lambda: self.m.json.test_api.output({})) | 735 step_test_data=lambda: self.m.json.test_api.output({})) |
OLD | NEW |