| 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 22 matching lines...) Expand all Loading... |
| 33 'rtc_stats_unittests', | 33 'rtc_stats_unittests', |
| 34 'rtc_unittests', | 34 'rtc_unittests', |
| 35 'system_wrappers_unittests', | 35 'system_wrappers_unittests', |
| 36 'test_support_unittests', | 36 'test_support_unittests', |
| 37 'tools_unittests', | 37 'tools_unittests', |
| 38 'video_engine_tests', | 38 'video_engine_tests', |
| 39 'voice_engine_unittests', | 39 'voice_engine_unittests', |
| 40 'xmllite_xmpp_unittests', | 40 'xmllite_xmpp_unittests', |
| 41 ) | 41 ) |
| 42 | 42 |
| 43 ANDROID_DEVICE_TESTS = ( | 43 # Android APK tests. |
| 44 ANDROID_APK_TESTS = ( |
| 44 'audio_decoder_unittests', | 45 'audio_decoder_unittests', |
| 45 'common_audio_unittests', | 46 'common_audio_unittests', |
| 46 'common_video_unittests', | 47 'common_video_unittests', |
| 47 'modules_tests', | 48 'modules_tests', |
| 48 'modules_unittests', | 49 'modules_unittests', |
| 49 'peerconnection_unittests', | 50 'peerconnection_unittests', |
| 50 'rtc_stats_unittests', | 51 'rtc_stats_unittests', |
| 51 'rtc_unittests', | 52 'rtc_unittests', |
| 52 'system_wrappers_unittests', | 53 'system_wrappers_unittests', |
| 53 'test_support_unittests', | 54 'test_support_unittests', |
| 54 'tools_unittests', | 55 'tools_unittests', |
| 55 'video_engine_tests', | 56 'video_engine_tests', |
| 56 'voice_engine_unittests', | 57 'voice_engine_unittests', |
| 57 'webrtc_nonparallel_tests', | 58 'webrtc_nonparallel_tests', |
| 58 ) | 59 ) |
| 59 | 60 |
| 60 ANDROID_LINUX_TESTS = ( | |
| 61 'android_junit_tests', | |
| 62 ) | |
| 63 | |
| 64 ANDROID_INSTRUMENTATION_TESTS = ( | 61 ANDROID_INSTRUMENTATION_TESTS = ( |
| 65 'AppRTCMobileTest', | 62 'AppRTCMobileTest', |
| 66 'libjingle_peerconnection_android_unittest', | 63 'libjingle_peerconnection_android_unittest', |
| 67 ) | 64 ) |
| 68 | 65 |
| 69 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' | 66 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' |
| 70 | 67 |
| 71 @property | 68 @property |
| 72 def should_build(self): | 69 def should_build(self): |
| 73 return self.bot_type in ('builder', 'builder_tester') | 70 return self.bot_type in ('builder', 'builder_tester') |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 self.m.gclient.apply_config(c) | 121 self.m.gclient.apply_config(c) |
| 125 | 122 |
| 126 if self.m.tryserver.is_tryserver: | 123 if self.m.tryserver.is_tryserver: |
| 127 self.m.chromium.apply_config('trybot_flavor') | 124 self.m.chromium.apply_config('trybot_flavor') |
| 128 | 125 |
| 129 def configure_swarming(self): | 126 def configure_swarming(self): |
| 130 self.c.use_isolate = self.bot_config.get('use_isolate') | 127 self.c.use_isolate = self.bot_config.get('use_isolate') |
| 131 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 128 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 132 if self.c.use_isolate: | 129 if self.c.use_isolate: |
| 133 self.m.isolate.set_isolate_environment(self.m.chromium.c) | 130 self.m.isolate.set_isolate_environment(self.m.chromium.c) |
| 134 self._isolated_targets = tuple() | |
| 135 if self.c.TEST_SUITE == 'webrtc': | 131 if self.c.TEST_SUITE == 'webrtc': |
| 136 self._isolated_targets += self.NORMAL_TESTS | 132 self._isolated_targets = self.NORMAL_TESTS |
| 137 if self.c.TEST_SUITE in ('android_linux', 'android_swarming'): | 133 elif self.c.TEST_SUITE == 'android': |
| 138 self._isolated_targets += self.ANDROID_LINUX_TESTS | 134 self._isolated_targets = (self.ANDROID_APK_TESTS + |
| 139 if self.c.TEST_SUITE in ('android_device', 'android_swarming'): | |
| 140 self._isolated_targets += (self.ANDROID_DEVICE_TESTS + | |
| 141 self.ANDROID_INSTRUMENTATION_TESTS) | 135 self.ANDROID_INSTRUMENTATION_TESTS) |
| 142 if not self._isolated_targets: # pragma: no cover | 136 else: # pragma: no cover |
| 143 raise self.m.step.StepFailure('Isolation and swarming are only ' | 137 raise self.m.step.StepFailure('Isolation and swarming are only ' |
| 144 'supported for webrtc, android_linux and ' | 138 'supported for webrtc and android test ' |
| 145 'android_device test suites.') | 139 'suites.') |
| 146 | 140 |
| 147 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 141 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 148 if self.c.enable_swarming: | 142 if self.c.enable_swarming: |
| 149 self.m.chromium_swarming.configure_swarming( | 143 self.m.chromium_swarming.configure_swarming( |
| 150 'webrtc', | 144 'webrtc', |
| 151 precommit=self.m.tryserver.is_tryserver, | 145 precommit=self.m.tryserver.is_tryserver, |
| 152 mastername=self.mastername) | 146 mastername=self.mastername) |
| 153 self.m.swarming.set_default_dimension( | 147 self.m.swarming.set_default_dimension( |
| 154 'os', | 148 'os', |
| 155 self.m.swarming.prefered_os_dimension( | 149 self.m.swarming.prefered_os_dimension( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 with self.m.step.context(context): | 196 with self.m.step.context(context): |
| 203 if self.c.use_isolate: | 197 if self.c.use_isolate: |
| 204 self.m.isolate.remove_build_metadata() | 198 self.m.isolate.remove_build_metadata() |
| 205 self.m.isolate.isolate_tests(self.m.chromium.output_dir, | 199 self.m.isolate.isolate_tests(self.m.chromium.output_dir, |
| 206 targets=self._isolated_targets) | 200 targets=self._isolated_targets) |
| 207 | 201 |
| 208 tests = steps.generate_tests(self, self.c.TEST_SUITE, self.revision, | 202 tests = steps.generate_tests(self, self.c.TEST_SUITE, self.revision, |
| 209 self.c.enable_swarming) | 203 self.c.enable_swarming) |
| 210 with self.m.step.defer_results(): | 204 with self.m.step.defer_results(): |
| 211 if tests: | 205 if tests: |
| 212 run_android_device_steps = (not self.c.enable_swarming and | 206 if (self.m.chromium.c.TARGET_PLATFORM == 'android' and |
| 213 self.m.chromium.c.TARGET_PLATFORM == 'android' and | 207 not self.c.enable_swarming): |
| 214 self.c.TEST_SUITE != 'android_linux') | |
| 215 | |
| 216 if run_android_device_steps: | |
| 217 self.m.chromium_android.common_tests_setup_steps() | 208 self.m.chromium_android.common_tests_setup_steps() |
| 218 | 209 |
| 219 for test in tests: | 210 for test in tests: |
| 220 test.run(self, suffix='') | 211 test.run(self, suffix='') |
| 221 | 212 |
| 222 if run_android_device_steps: | 213 if (self.m.chromium.c.TARGET_PLATFORM == 'android' and |
| 214 not self.c.enable_swarming): |
| 223 self.m.chromium_android.shutdown_device_monitor() | 215 self.m.chromium_android.shutdown_device_monitor() |
| 224 self.m.chromium_android.logcat_dump( | 216 self.m.chromium_android.logcat_dump( |
| 225 gs_bucket=self.master_config.get('build_gs_bucket')) | 217 gs_bucket=self.master_config.get('build_gs_bucket')) |
| 226 self.m.chromium_android.stack_tool_steps(force_latest_version=True) | 218 self.m.chromium_android.stack_tool_steps(force_latest_version=True) |
| 227 self.m.chromium_android.test_report() | 219 self.m.chromium_android.test_report() |
| 228 | 220 |
| 229 with self.m.step.defer_results(): | 221 with self.m.step.defer_results(): |
| 230 for test in tests: | 222 for test in tests: |
| 231 if test.enable_swarming: | 223 if test.enable_swarming: |
| 232 self.m.swarming.collect_task(test.swarming_task) | 224 self.m.swarming.collect_task(test.swarming_task) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 def clean_test_output(self): | 341 def clean_test_output(self): |
| 350 """Remove all test output in out/, since we have tests leaking files.""" | 342 """Remove all test output in out/, since we have tests leaking files.""" |
| 351 out_dir = self.m.path['checkout'].join('out') | 343 out_dir = self.m.path['checkout'].join('out') |
| 352 self.m.python('clean test output files', | 344 self.m.python('clean test output files', |
| 353 script=self.resource('cleanup_files.py'), | 345 script=self.resource('cleanup_files.py'), |
| 354 args=[out_dir], | 346 args=[out_dir], |
| 355 infra_step=True) | 347 infra_step=True) |
| 356 | 348 |
| 357 def virtual_webcam_check(self): | 349 def virtual_webcam_check(self): |
| 358 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) | 350 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) |
| OLD | NEW |