| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 @property | 88 @property |
| 89 def should_test(self): | 89 def should_test(self): |
| 90 return self.bot_type in ('tester', 'builder_tester') | 90 return self.bot_type in ('tester', 'builder_tester') |
| 91 | 91 |
| 92 @property | 92 @property |
| 93 def should_upload_build(self): | 93 def should_upload_build(self): |
| 94 return self.bot_config.get('triggers') | 94 return self.bot_config.get('triggers') |
| 95 | 95 |
| 96 @property | 96 @property |
| 97 def should_upload_apprtcmobile(self): |
| 98 return self.bot_config.get('archive_apprtc') |
| 99 |
| 100 @property |
| 97 def should_download_build(self): | 101 def should_download_build(self): |
| 98 return self.bot_config.get('parent_buildername') | 102 return self.bot_config.get('parent_buildername') |
| 99 | 103 |
| 100 def apply_bot_config(self, builders, recipe_configs, perf_config=None): | 104 def apply_bot_config(self, builders, recipe_configs, perf_config=None): |
| 101 self.mastername = self.m.properties.get('mastername') | 105 self.mastername = self.m.properties.get('mastername') |
| 102 self.buildername = self.m.properties.get('buildername') | 106 self.buildername = self.m.properties.get('buildername') |
| 103 master_dict = builders.get(self.mastername, {}) | 107 master_dict = builders.get(self.mastername, {}) |
| 104 self.master_config = master_dict.get('settings', {}) | 108 self.master_config = master_dict.get('settings', {}) |
| 105 perf_config = self.master_config.get('PERF_CONFIG') | 109 perf_config = self.master_config.get('PERF_CONFIG') |
| 106 | 110 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 """Add a suite of test steps. | 216 """Add a suite of test steps. |
| 213 | 217 |
| 214 Args: | 218 Args: |
| 215 test_suite: The name of the test suite. | 219 test_suite: The name of the test suite. |
| 216 """ | 220 """ |
| 217 context = {} | 221 context = {} |
| 218 if self._working_dir: | 222 if self._working_dir: |
| 219 context['cwd'] = self._working_dir | 223 context['cwd'] = self._working_dir |
| 220 | 224 |
| 221 with self.m.step.context(context): | 225 with self.m.step.context(context): |
| 222 if self.should_download_build and self.c.use_isolate: | |
| 223 self.m.isolate.find_isolated_tests(self.m.chromium.output_dir, | |
| 224 self._isolated_targets) | |
| 225 tests = steps.generate_tests(self, self.c.TEST_SUITE, self.revision, | 226 tests = steps.generate_tests(self, self.c.TEST_SUITE, self.revision, |
| 226 self.c.enable_swarming) | 227 self.c.enable_swarming) |
| 227 with self.m.step.defer_results(): | 228 with self.m.step.defer_results(): |
| 228 if tests: | 229 if tests: |
| 229 run_android_device_steps = (not self.c.enable_swarming and | 230 run_android_device_steps = (not self.c.enable_swarming and |
| 230 self.m.chromium.c.TARGET_PLATFORM == 'android' and | 231 self.m.chromium.c.TARGET_PLATFORM == 'android' and |
| 231 self.c.TEST_SUITE != 'android_swarming') | 232 self.c.TEST_SUITE != 'android_swarming') |
| 232 | 233 |
| 233 if run_android_device_steps: | 234 if run_android_device_steps: |
| 234 self.m.chromium_android.common_tests_setup_steps() | 235 self.m.chromium_android.common_tests_setup_steps() |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 def package_build(self): | 312 def package_build(self): |
| 312 upload_url = self.m.archive.legacy_upload_url( | 313 upload_url = self.m.archive.legacy_upload_url( |
| 313 self.master_config.get('build_gs_bucket'), | 314 self.master_config.get('build_gs_bucket'), |
| 314 extra_url_components=self.mastername) | 315 extra_url_components=self.mastername) |
| 315 self.m.archive.zip_and_upload_build( | 316 self.m.archive.zip_and_upload_build( |
| 316 'package build', | 317 'package build', |
| 317 self.m.chromium.c.build_config_fs, | 318 self.m.chromium.c.build_config_fs, |
| 318 upload_url, | 319 upload_url, |
| 319 build_revision=self.revision) | 320 build_revision=self.revision) |
| 320 | 321 |
| 322 def package_apprtcmobile(self): |
| 321 # Zip and upload out/{Debug,Release}/apks/AppRTCMobile.apk | 323 # Zip and upload out/{Debug,Release}/apks/AppRTCMobile.apk |
| 322 if self.bot_config.get('archive_apprtc', False): | 324 apk_root = self.m.chromium.c.build_dir.join( |
| 323 apk_root = self.m.chromium.c.build_dir.join( | 325 self.m.chromium.c.build_config_fs, 'apks') |
| 324 self.m.chromium.c.build_config_fs, 'apks') | 326 zip_path = self.m.path['slave_build'].join('AppRTCMobile_apk.zip') |
| 325 zip_path = self.m.path['slave_build'].join('AppRTCMobile_apk.zip') | |
| 326 | 327 |
| 327 pkg = self.m.zip.make_package(apk_root, zip_path) | 328 pkg = self.m.zip.make_package(apk_root, zip_path) |
| 328 pkg.add_file(apk_root.join('AppRTCMobile.apk')) | 329 pkg.add_file(apk_root.join('AppRTCMobile.apk')) |
| 329 pkg.zip('AppRTCMobile zip archive') | 330 pkg.zip('AppRTCMobile zip archive') |
| 330 | 331 |
| 331 apk_upload_url = 'client.webrtc/%s/AppRTCMobile_apk_%s.zip' % ( | 332 apk_upload_url = 'client.webrtc/%s/AppRTCMobile_apk_%s.zip' % ( |
| 332 self.buildername, self.revision_number) | 333 self.buildername, self.revision_number) |
| 333 self.m.gsutil.upload(zip_path, 'chromium-webrtc', apk_upload_url, | 334 self.m.gsutil.upload(zip_path, 'chromium-webrtc', apk_upload_url, |
| 334 args=['-a', 'public-read'], unauthenticated_url=True) | 335 args=['-a', 'public-read'], unauthenticated_url=True) |
| 335 | 336 |
| 336 def extract_build(self): | 337 def extract_build(self): |
| 337 if not self.m.properties.get('parent_got_revision'): | 338 if not self.m.properties.get('parent_got_revision'): |
| 338 raise self.m.step.StepFailure( | 339 raise self.m.step.StepFailure( |
| 339 'Testers cannot be forced without providing revision information. ' | 340 'Testers cannot be forced without providing revision information. ' |
| 340 'Please select a previous build and click [Rebuild] or force a build ' | 341 'Please select a previous build and click [Rebuild] or force a build ' |
| 341 'for a Builder instead (will trigger new runs for the testers).') | 342 'for a Builder instead (will trigger new runs for the testers).') |
| 342 | 343 |
| 343 # Ensure old build directory isn't being used by removing it. | 344 # Ensure old build directory isn't being used by removing it. |
| 344 self.m.file.rmtree( | 345 self.m.file.rmtree( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 366 def clean_test_output(self): | 367 def clean_test_output(self): |
| 367 """Remove all test output in out/, since we have tests leaking files.""" | 368 """Remove all test output in out/, since we have tests leaking files.""" |
| 368 out_dir = self.m.path['checkout'].join('out') | 369 out_dir = self.m.path['checkout'].join('out') |
| 369 self.m.python('clean test output files', | 370 self.m.python('clean test output files', |
| 370 script=self.resource('cleanup_files.py'), | 371 script=self.resource('cleanup_files.py'), |
| 371 args=[out_dir], | 372 args=[out_dir], |
| 372 infra_step=True) | 373 infra_step=True) |
| 373 | 374 |
| 374 def virtual_webcam_check(self): | 375 def virtual_webcam_check(self): |
| 375 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) | 376 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) |
| OLD | NEW |