Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 | 5 |
| 6 def generate_tests(api, test_suite, revision, enable_swarming=False): | 6 def generate_tests(api, test_suite, revision, enable_swarming=False): |
| 7 tests = [] | 7 tests = [] |
| 8 if test_suite == 'webrtc': | 8 if test_suite == 'webrtc': |
| 9 for test in api.NORMAL_TESTS: | 9 for test in api.NORMAL_TESTS: |
| 10 tests.append(WebRTCTest(test, revision, enable_swarming=enable_swarming)) | 10 tests.append(WebRTCTest(test, revision, enable_swarming=enable_swarming)) |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 api.virtual_webcam_check() # Needed for video_capture_tests below. | 40 api.virtual_webcam_check() # Needed for video_capture_tests below. |
| 41 | 41 |
| 42 # This test currently fails on Trusty Linux due to pulseaudio issues. See | 42 # This test currently fails on Trusty Linux due to pulseaudio issues. See |
| 43 # http://crbug.com/589101 | 43 # http://crbug.com/589101 |
| 44 if api.m.platform.is_mac or api.m.platform.is_win: | 44 if api.m.platform.is_mac or api.m.platform.is_win: |
| 45 tests.append(BaremetalTest('audio_device_tests', revision)) | 45 tests.append(BaremetalTest('audio_device_tests', revision)) |
| 46 | 46 |
| 47 tests.extend([ | 47 tests.extend([ |
| 48 BaremetalTest('voe_auto_test', revision, args=['--automated']), | 48 BaremetalTest('voe_auto_test', revision, args=['--automated']), |
| 49 BaremetalTest('video_capture_tests', revision), | 49 BaremetalTest('video_capture_tests', revision), |
| 50 BaremetalTest('webrtc_perf_tests', revision, perf_test=True), | |
| 51 ]) | 50 ]) |
| 51 if not api.m.tryserver.is_tryserver: | |
| 52 tests.append(BaremetalTest('webrtc_perf_tests', revision, perf_test=True)) | |
| 53 | |
| 52 elif test_suite == 'android': | 54 elif test_suite == 'android': |
| 53 for test in api.ANDROID_APK_TESTS: | 55 for test in api.ANDROID_APK_TESTS: |
| 54 tests.append(AndroidTest(test)) | 56 tests.append(AndroidTest(test)) |
| 55 tests.append(AndroidPerfTest('webrtc_perf_tests', revision, | 57 if (not api.m.tryserver.is_tryserver and api.c.PERF_ID and |
| 56 perf_id=api.c.PERF_ID)) | 58 api.m.chromium.c.BUILD_CONFIG == 'Release'): |
| 59 tests.append(AndroidPerfTest('webrtc_perf_tests', revision, | |
| 60 perf_id=api.c.PERF_ID)) | |
| 57 for test_name in api.ANDROID_INSTRUMENTATION_TESTS: | 61 for test_name in api.ANDROID_INSTRUMENTATION_TESTS: |
| 58 tests.append(AndroidInstrumentationTest(test_name)) | 62 tests.append(AndroidInstrumentationTest(test_name)) |
| 59 | 63 |
| 60 return tests | 64 return tests |
| 61 | 65 |
| 62 | 66 |
| 63 # TODO(kjellander): Continue refactoring an integrate the classes in the | 67 # TODO(kjellander): Continue refactoring an integrate the classes in the |
| 64 # chromium_tests recipe module instead (if possible). | 68 # chromium_tests recipe module instead (if possible). |
| 65 class Test(object): | 69 class Test(object): |
| 66 def __init__(self, name, enable_swarming=False): | 70 def __init__(self, name, enable_swarming=False): |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 142 |
| 139 class AndroidPerfTest(Test): | 143 class AndroidPerfTest(Test): |
| 140 """A performance test to run on Android devices. | 144 """A performance test to run on Android devices. |
| 141 | 145 |
| 142 Basically just wrap what happens in chromium_android.run_test_suite to run | 146 Basically just wrap what happens in chromium_android.run_test_suite to run |
| 143 inside runtest.py so we can scrape perf data. This way we can get perf data | 147 inside runtest.py so we can scrape perf data. This way we can get perf data |
| 144 from the gtest binaries since the way of running perf tests with telemetry | 148 from the gtest binaries since the way of running perf tests with telemetry |
| 145 is entirely different. | 149 is entirely different. |
| 146 """ | 150 """ |
| 147 | 151 |
| 148 def __init__(self, name, revision, perf_id=None): | 152 def __init__(self, name, revision, perf_id): |
| 149 super(AndroidPerfTest, self).__init__(name) | 153 super(AndroidPerfTest, self).__init__(name) |
| 150 self._revision = revision | 154 self._revision = revision |
| 151 self._perf_id = perf_id | 155 self._perf_id = perf_id |
| 156 assert perf_id, 'You must specify a Perf ID for builders running perf tests' | |
| 152 | 157 |
| 153 def run(self, api, suffix): | 158 def run(self, api, suffix): |
| 154 if not self._perf_id or api.m.chromium.c.BUILD_CONFIG == 'Debug': | 159 assert api.m.chromium.c.BUILD_CONFIG == 'Release', ( |
| 155 # Run as a normal test for trybots and Debug, without perf data scraping. | 160 'Perf tests should only be run with Release builds.') |
|
phoglund_chromium
2016/06/02 07:55:02
Nice!
| |
| 156 api.m.chromium_android.run_test_suite( | 161 wrapper_script = api.m.chromium.output_dir.join('bin', |
| 157 self._name, | 162 'run_%s' % self._name) |
| 158 tool=get_android_tool(api)) | 163 args = ['--verbose'] |
| 159 else: | 164 api.add_test(name=self._name, |
| 160 wrapper_script = api.m.chromium.output_dir.join('bin', | 165 test=wrapper_script, |
| 161 'run_%s' % self._name) | 166 args=args, |
| 162 args = ['--verbose'] | 167 revision=self._revision, |
| 163 api.add_test(name=self._name, | 168 python_mode=True, |
| 164 test=wrapper_script, | 169 perf_test=True, |
| 165 args=args, | 170 perf_dashboard_id=self._name) |
| 166 revision=self._revision, | |
| 167 python_mode=True, | |
| 168 perf_test=True, | |
| 169 perf_dashboard_id=self._name) | |
| 170 | 171 |
| OLD | NEW |