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 |
| 11 class WebRTCApi(recipe_api.RecipeApi): | 11 class WebRTCApi(recipe_api.RecipeApi): |
| 12 def __init__(self, **kwargs): | 12 def __init__(self, **kwargs): |
| 13 super(WebRTCApi, self).__init__(**kwargs) | 13 super(WebRTCApi, self).__init__(**kwargs) |
| 14 self._env = {} | 14 self._env = {} |
| 15 self._isolated_targets = None | 15 self._isolated_targets = None |
| 16 | 16 |
| 17 # Keep track of working directory (which contains the checkout). | 17 # Keep track of working directory (which contains the checkout). |
| 18 # None means "default value". | 18 # None means "default value". |
| 19 self._working_dir = None | 19 self._working_dir = None |
| 20 | 20 |
| 21 BUILDERS = builders.BUILDERS | 21 BUILDERS = builders.BUILDERS |
| 22 RECIPE_CONFIGS = builders.RECIPE_CONFIGS | 22 RECIPE_CONFIGS = builders.RECIPE_CONFIGS |
| 23 | 23 |
| 24 NORMAL_TESTS = freeze({ | 24 NORMAL_TESTS = freeze({ |
| 25 'audio_decoder_unittests': {}, | 25 'audio_decoder_unittests': {}, |
| 26 'common_audio_unittests': {}, | 26 'common_audio_unittests': {}, |
| 27 'common_video_unittests': {}, | 27 'common_video_unittests': {}, |
| 28 'modules_tests': { | 28 'modules_tests': { |
| 29 'shards': 2, | 29 'swarming_shards': 2, |
| 30 }, | 30 }, |
| 31 'modules_unittests': { | 31 'modules_unittests': { |
| 32 'shards': 6, | 32 'swarming_shards': 6, |
| 33 }, | 33 }, |
| 34 'peerconnection_unittests': { | 34 'peerconnection_unittests': { |
| 35 'shards': 4, | 35 'swarming_shards': 4, |
| 36 }, | 36 }, |
| 37 'rtc_media_unittests': {}, | 37 'rtc_media_unittests': {}, |
| 38 'rtc_pc_unittests': {}, | 38 'rtc_pc_unittests': {}, |
| 39 'rtc_stats_unittests': {}, | 39 'rtc_stats_unittests': {}, |
| 40 'rtc_unittests': { | 40 'rtc_unittests': { |
| 41 'shards': 6, | 41 'swarming_shards': 6, |
| 42 }, | 42 }, |
| 43 'system_wrappers_unittests': {}, | 43 'system_wrappers_unittests': {}, |
| 44 'test_support_unittests': {}, | 44 'test_support_unittests': {}, |
| 45 'tools_unittests': {}, | 45 'tools_unittests': {}, |
| 46 'video_engine_tests': { | 46 'video_engine_tests': { |
| 47 'shards': 4, | 47 'swarming_shards': 4, |
| 48 }, | 48 }, |
| 49 'voice_engine_unittests': {}, | 49 'voice_engine_unittests': {}, |
| 50 'webrtc_nonparallel_tests': { | 50 'webrtc_nonparallel_tests': { |
| 51 'parallel': False, | 51 'parallel': False, |
| 52 }, | 52 }, |
| 53 'xmllite_xmpp_unittests': {}, | 53 'xmllite_xmpp_unittests': {}, |
| 54 }) | 54 }) |
| 55 | 55 |
| 56 ANDROID_DEVICE_TESTS = freeze({ | 56 ANDROID_DEVICE_TESTS = ( |
| 57 'audio_decoder_unittests': {}, | 57 'audio_decoder_unittests', |
| 58 'common_audio_unittests': {}, | 58 'common_audio_unittests', |
| 59 'common_video_unittests': {}, | 59 'common_video_unittests', |
| 60 'modules_tests': {}, | 60 'modules_tests', |
| 61 'modules_unittests': {}, | 61 'modules_unittests', |
| 62 'peerconnection_unittests': {}, | 62 'peerconnection_unittests', |
| 63 'rtc_stats_unittests': {}, | 63 'rtc_stats_unittests', |
| 64 'rtc_unittests': {}, | 64 'rtc_unittests', |
| 65 'system_wrappers_unittests': {}, | 65 'system_wrappers_unittests', |
| 66 'test_support_unittests': {}, | 66 'test_support_unittests', |
| 67 'tools_unittests': {}, | 67 'tools_unittests', |
| 68 'video_engine_tests': {}, | 68 'video_engine_tests', |
| 69 'voice_engine_unittests': {}, | 69 'voice_engine_unittests', |
| 70 'webrtc_nonparallel_tests': {}, | 70 'webrtc_nonparallel_tests', |
| 71 }) | 71 ) |
| 72 | 72 |
| 73 ANDROID_INSTRUMENTATION_TESTS = freeze({ | 73 ANDROID_INSTRUMENTATION_TESTS = ( |
| 74 'AppRTCMobileTest': {}, | 74 'AppRTCMobileTest', |
| 75 'libjingle_peerconnection_android_unittest': {}, | 75 'libjingle_peerconnection_android_unittest', |
| 76 }) | 76 ) |
| 77 | 77 |
| 78 ANDROID_JUNIT_TESTS = freeze({ | 78 ANDROID_JUNIT_TESTS = ( |
| 79 'android_junit_tests': {}, | 79 'android_junit_tests', |
| 80 }) | 80 ) |
| 81 | 81 |
| 82 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' | 82 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' |
| 83 | 83 |
| 84 @property | 84 @property |
| 85 def should_build(self): | 85 def should_build(self): |
| 86 return self.bot_type in ('builder', 'builder_tester') | 86 return self.bot_type in ('builder', 'builder_tester') |
| 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') |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 self.m.gclient.apply_config(c) | 141 self.m.gclient.apply_config(c) |
| 142 | 142 |
| 143 if self.m.tryserver.is_tryserver: | 143 if self.m.tryserver.is_tryserver: |
| 144 self.m.chromium.apply_config('trybot_flavor') | 144 self.m.chromium.apply_config('trybot_flavor') |
| 145 | 145 |
| 146 def configure_swarming(self): | 146 def configure_swarming(self): |
| 147 self.c.use_isolate = self.bot_config.get('use_isolate') | 147 self.c.use_isolate = self.bot_config.get('use_isolate') |
| 148 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 148 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 149 if self.c.use_isolate: | 149 if self.c.use_isolate: |
| 150 self.m.isolate.set_isolate_environment(self.m.chromium.c) | 150 self.m.isolate.set_isolate_environment(self.m.chromium.c) |
| 151 self._isolated_targets = [] | |
| 152 if self.c.TEST_SUITE == 'webrtc': | 151 if self.c.TEST_SUITE == 'webrtc': |
| 153 self._isolated_targets += self.NORMAL_TESTS.keys() | 152 self._isolated_targets = (self.NORMAL_TESTS.keys()) |
| 154 if self.c.TEST_SUITE == 'android_swarming': | 153 elif self.c.TEST_SUITE == 'android_swarming': |
| 155 self._isolated_targets += (self.ANDROID_JUNIT_TESTS.keys() + | 154 self._isolated_targets = (self.ANDROID_DEVICE_TESTS + |
| 156 self.ANDROID_DEVICE_TESTS.keys() + | 155 self.ANDROID_INSTRUMENTATION_TESTS) |
| 157 self.ANDROID_INSTRUMENTATION_TESTS.keys()) | |
| 158 self._isolated_targets = sorted(self._isolated_targets) | 156 self._isolated_targets = sorted(self._isolated_targets) |
| 159 if not self._isolated_targets: # pragma: no cover | 157 if not self._isolated_targets: # pragma: no cover |
| 160 raise self.m.step.StepFailure('Isolation and swarming are only ' | 158 raise self.m.step.StepFailure('Isolation and swarming are only ' |
| 161 'supported for webrtc and ' | 159 'supported for webrtc and ' |
| 162 'android_swarming test suites.') | 160 'android_swarming test suites.') |
| 163 | 161 |
| 164 self.c.enable_swarming = self.bot_config.get('enable_swarming') | 162 self.c.enable_swarming = self.bot_config.get('enable_swarming') |
| 165 if self.c.enable_swarming: | 163 if self.c.enable_swarming: |
| 166 self.m.chromium_swarming.configure_swarming( | 164 self.m.chromium_swarming.configure_swarming( |
| 167 'webrtc', | 165 'webrtc', |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 with self.m.step.defer_results(): | 226 with self.m.step.defer_results(): |
| 229 if tests: | 227 if tests: |
| 230 run_android_device_steps = (not self.c.enable_swarming and | 228 run_android_device_steps = (not self.c.enable_swarming and |
| 231 self.m.chromium.c.TARGET_PLATFORM == 'android' and | 229 self.m.chromium.c.TARGET_PLATFORM == 'android' and |
| 232 self.c.TEST_SUITE != 'android_swarming') | 230 self.c.TEST_SUITE != 'android_swarming') |
| 233 | 231 |
| 234 if run_android_device_steps: | 232 if run_android_device_steps: |
| 235 self.m.chromium_android.common_tests_setup_steps() | 233 self.m.chromium_android.common_tests_setup_steps() |
| 236 | 234 |
| 237 for test in tests: | 235 for test in tests: |
| 236 test.pre_run(self, suffix='') | |
|
kjellander_chromium
2016/10/21 11:04:07
https://cs.chromium.org/chromium/build/scripts/sla
ehmaldonado_chromium
2016/10/21 13:12:49
Good point.
This doesn't change the behavior we ha
| |
| 237 | |
| 238 for test in tests: | |
| 238 test.run(self, suffix='') | 239 test.run(self, suffix='') |
| 239 | 240 |
| 241 for test in tests: | |
| 242 test.post_run(self, suffix='') | |
| 243 | |
| 240 if run_android_device_steps: | 244 if run_android_device_steps: |
| 241 self.m.chromium_android.shutdown_device_monitor() | 245 self.m.chromium_android.shutdown_device_monitor() |
| 242 self.m.chromium_android.logcat_dump( | 246 self.m.chromium_android.logcat_dump( |
| 243 gs_bucket=self.master_config.get('build_gs_bucket')) | 247 gs_bucket=self.master_config.get('build_gs_bucket')) |
| 244 self.m.chromium_android.stack_tool_steps(force_latest_version=True) | 248 self.m.chromium_android.stack_tool_steps(force_latest_version=True) |
| 245 self.m.chromium_android.test_report() | 249 self.m.chromium_android.test_report() |
| 246 | 250 |
| 247 with self.m.step.defer_results(): | 251 with self.m.step.defer_results(): |
| 248 for test in tests: | 252 for test in tests: |
| 249 if test.enable_swarming: | 253 if test.enable_swarming: |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 def clean_test_output(self): | 371 def clean_test_output(self): |
| 368 """Remove all test output in out/, since we have tests leaking files.""" | 372 """Remove all test output in out/, since we have tests leaking files.""" |
| 369 out_dir = self.m.path['checkout'].join('out') | 373 out_dir = self.m.path['checkout'].join('out') |
| 370 self.m.python('clean test output files', | 374 self.m.python('clean test output files', |
| 371 script=self.resource('cleanup_files.py'), | 375 script=self.resource('cleanup_files.py'), |
| 372 args=[out_dir], | 376 args=[out_dir], |
| 373 infra_step=True) | 377 infra_step=True) |
| 374 | 378 |
| 375 def virtual_webcam_check(self): | 379 def virtual_webcam_check(self): |
| 376 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) | 380 self.m.python('webcam_check', self.resource('ensure_webcam_is_running.py')) |
| OLD | NEW |