Chromium Code Reviews| 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 from recipe_engine.types import freeze | 5 from recipe_engine.types import freeze |
| 6 from recipe_engine import recipe_api | 6 from recipe_engine import recipe_api |
| 7 from . import builders | 7 from . import builders |
| 8 from . import steps | 8 from . import steps |
| 9 | 9 |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 ) | 64 ) |
| 65 | 65 |
| 66 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' | 66 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' |
| 67 | 67 |
| 68 @property | 68 @property |
| 69 def should_build(self): | 69 def should_build(self): |
| 70 return self.bot_type in ('builder', 'builder_tester') | 70 return self.bot_type in ('builder', 'builder_tester') |
| 71 | 71 |
| 72 @property | 72 @property |
| 73 def should_test(self): | 73 def should_test(self): |
| 74 return self.bot_type in ('tester', 'builder_tester') | 74 return (self.bot_type in ('tester', 'builder_tester') or |
| 75 self.additional_tests) | |
|
kjellander_chromium
2016/09/23 19:24:24
Since a 'builder_tester' can both build (+upload t
| |
| 75 | 76 |
| 76 @property | 77 @property |
| 77 def should_upload_build(self): | 78 def should_upload_build(self): |
| 78 return self.bot_config.get('triggers') | 79 return self.bot_config.get('triggers') |
| 79 | 80 |
| 80 @property | 81 @property |
| 81 def should_download_build(self): | 82 def should_download_build(self): |
| 82 return self.bot_config.get('parent_buildername') | 83 return self.bot_config.get('parent_buildername') |
| 83 | 84 |
| 84 def apply_bot_config(self, builders, recipe_configs, perf_config=None): | 85 def apply_bot_config(self, builders, recipe_configs, perf_config=None): |
| 85 self.mastername = self.m.properties.get('mastername') | 86 self.mastername = self.m.properties.get('mastername') |
| 86 self.buildername = self.m.properties.get('buildername') | 87 self.buildername = self.m.properties.get('buildername') |
| 87 master_dict = builders.get(self.mastername, {}) | 88 master_dict = builders.get(self.mastername, {}) |
| 88 self.master_config = master_dict.get('settings', {}) | 89 self.master_config = master_dict.get('settings', {}) |
| 89 perf_config = self.master_config.get('PERF_CONFIG') | 90 perf_config = self.master_config.get('PERF_CONFIG') |
| 90 | 91 |
| 91 self.bot_config = master_dict.get('builders', {}).get(self.buildername) | 92 self.bot_config = master_dict.get('builders', {}).get(self.buildername) |
| 92 assert self.bot_config, ('Unrecognized builder name "%r" for master "%r".' % | 93 assert self.bot_config, ('Unrecognized builder name "%r" for master "%r".' % |
| 93 (self.buildername, self.mastername)) | 94 (self.buildername, self.mastername)) |
| 94 | 95 |
| 95 self.bot_type = self.bot_config.get('bot_type', 'builder_tester') | 96 self.bot_type = self.bot_config.get('bot_type', 'builder_tester') |
| 96 recipe_config_name = self.bot_config['recipe_config'] | 97 recipe_config_name = self.bot_config['recipe_config'] |
| 97 self.recipe_config = recipe_configs.get(recipe_config_name) | 98 self.recipe_config = recipe_configs.get(recipe_config_name) |
| 98 assert self.recipe_config, ( | 99 assert self.recipe_config, ( |
| 99 'Cannot find recipe_config "%s" for builder "%r".' % | 100 'Cannot find recipe_config "%s" for builder "%r".' % |
| 100 (recipe_config_name, self.buildername)) | 101 (recipe_config_name, self.buildername)) |
| 101 | 102 |
| 102 self.set_config('webrtc', PERF_CONFIG=perf_config, | 103 self.additional_tests = self.bot_config.get('additional_tests', {}) |
| 103 TEST_SUITE=self.recipe_config.get('test_suite'), | 104 |
| 105 test_suite = 'none' | |
| 106 if self.bot_type in ('tester', 'builder_tester'): | |
| 107 test_suite = self.recipe_config.get('test_suite') | |
| 108 self.set_config('webrtc', PERF_CONFIG=perf_config, TEST_SUITE=test_suite, | |
| 104 **self.bot_config.get('webrtc_config_kwargs', {})) | 109 **self.bot_config.get('webrtc_config_kwargs', {})) |
| 105 | 110 |
| 106 chromium_kwargs = self.bot_config.get('chromium_config_kwargs', {}) | 111 chromium_kwargs = self.bot_config.get('chromium_config_kwargs', {}) |
| 107 if self.recipe_config.get('chromium_android_config'): | 112 if self.recipe_config.get('chromium_android_config'): |
| 108 self.m.chromium_android.set_config( | 113 self.m.chromium_android.set_config( |
| 109 self.recipe_config['chromium_android_config'], **chromium_kwargs) | 114 self.recipe_config['chromium_android_config'], **chromium_kwargs) |
| 110 | 115 |
| 111 self.m.chromium.set_config(self.recipe_config['chromium_config'], | 116 self.m.chromium.set_config(self.recipe_config['chromium_config'], |
| 112 **chromium_kwargs) | 117 **chromium_kwargs) |
| 113 self.m.gclient.set_config(self.recipe_config['gclient_config']) | 118 self.m.gclient.set_config(self.recipe_config['gclient_config']) |
| 114 | 119 |
| 115 # Support applying configs both at the bot and the recipe config level. | 120 # Support applying configs both at the bot and the recipe config level. |
| 116 for c in self.bot_config.get('chromium_apply_config', []): | 121 for c in self.bot_config.get('chromium_apply_config', []): |
| 117 self.m.chromium.apply_config(c) | 122 self.m.chromium.apply_config(c) |
| 118 for c in self.bot_config.get('gclient_apply_config', []): | 123 for c in self.bot_config.get('gclient_apply_config', []): |
| 119 self.m.gclient.apply_config(c) | 124 self.m.gclient.apply_config(c) |
| 120 for c in self.recipe_config.get('gclient_apply_config', []): | 125 for c in self.recipe_config.get('gclient_apply_config', []): |
| 121 self.m.gclient.apply_config(c) | 126 self.m.gclient.apply_config(c) |
| 122 | 127 |
| 123 if self.m.tryserver.is_tryserver: | 128 if self.m.tryserver.is_tryserver: |
| 124 self.m.chromium.apply_config('trybot_flavor') | 129 self.m.chromium.apply_config('trybot_flavor') |
| 125 | 130 |
| 126 def configure_swarming(self): | 131 def configure_swarming(self): |
| 127 self.c.use_isolate = self.bot_config.get('use_isolate') | 132 self.c.use_isolate = self.bot_config.get('use_isolate') |
| 128 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 133 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 129 if self.c.use_isolate: | 134 if self.c.use_isolate: |
| 130 self.m.isolate.set_isolate_environment(self.m.chromium.c) | 135 self.m.isolate.set_isolate_environment(self.m.chromium.c) |
| 136 self._isolated_targets = tuple() | |
| 137 for test_type in self.additional_tests.values(): | |
| 138 self._isolated_targets += tuple(test_type) | |
| 131 if self.c.TEST_SUITE == 'webrtc': | 139 if self.c.TEST_SUITE == 'webrtc': |
| 132 self._isolated_targets = self.NORMAL_TESTS | 140 self._isolated_targets += self.NORMAL_TESTS |
| 133 elif self.c.TEST_SUITE == 'android': | 141 elif self.c.TEST_SUITE == 'android': |
| 134 self._isolated_targets = (self.ANDROID_APK_TESTS + | 142 self._isolated_targets += (self.ANDROID_APK_TESTS + |
| 135 self.ANDROID_INSTRUMENTATION_TESTS) | 143 self.ANDROID_INSTRUMENTATION_TESTS) |
|
kjellander_chromium
2016/09/23 19:24:24
+ ('android_junit_tests'),
| |
| 136 else: # pragma: no cover | 144 else: # pragma: no cover |
| 137 raise self.m.step.StepFailure('Isolation and swarming are only ' | 145 raise self.m.step.StepFailure('Isolation and swarming are only ' |
| 138 'supported for webrtc and android test ' | 146 'supported for webrtc and android test ' |
| 139 'suites.') | 147 'suites.') |
| 140 | 148 |
| 141 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 149 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 142 if self.c.enable_swarming: | 150 if self.c.enable_swarming: |
| 143 self.m.chromium_swarming.configure_swarming( | 151 self.m.chromium_swarming.configure_swarming( |
| 144 'webrtc', | 152 'webrtc', |
| 145 precommit=self.m.tryserver.is_tryserver, | 153 precommit=self.m.tryserver.is_tryserver, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 def clean_test_output(self): | 349 def clean_test_output(self): |
| 342 """Remove all test output in out/, since we have tests leaking files.""" | 350 """Remove all test output in out/, since we have tests leaking files.""" |
| 343 out_dir = self.m.path['checkout'].join('out') | 351 out_dir = self.m.path['checkout'].join('out') |
| 344 self.m.python('clean test output files', | 352 self.m.python('clean test output files', |
| 345 script=self.resource('cleanup_files.py'), | 353 script=self.resource('cleanup_files.py'), |
| 346 args=[out_dir], | 354 args=[out_dir], |
| 347 infra_step=True) | 355 infra_step=True) |
| 348 | 356 |
| 349 def virtual_webcam_check(self): | 357 def virtual_webcam_check(self): |
| 350 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) | 358 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) |
| OLD | NEW |