OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import collections | 6 import collections |
7 import glob | 7 import glob |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import optparse | 10 import optparse |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 args.append('--tool=asan') | 155 args.append('--tool=asan') |
156 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) | 156 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) |
157 RunCmd(['build/android/run_browser_tests.py'] + args) | 157 RunCmd(['build/android/run_browser_tests.py'] + args) |
158 | 158 |
159 def RunChromeDriverTests(): | 159 def RunChromeDriverTests(): |
160 """Run all the steps for running chromedriver tests.""" | 160 """Run all the steps for running chromedriver tests.""" |
161 buildbot_report.PrintNamedStep('chromedriver_annotation') | 161 buildbot_report.PrintNamedStep('chromedriver_annotation') |
162 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', | 162 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
163 '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) | 163 '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) |
164 | 164 |
| 165 |
| 166 def CheckInstall(): |
| 167 """Build bot step to see if adb install works on attached devices. """ |
| 168 buildbot_report.PrintNamedStep('Check device install') |
| 169 # This step checks if apks can be installed on the devices. |
| 170 args = ['--apk', 'build/android/CheckInstallApk-debug.apk'] |
| 171 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
| 172 |
| 173 |
165 def InstallApk(options, test, print_step=False): | 174 def InstallApk(options, test, print_step=False): |
166 """Install an apk to all phones. | 175 """Install an apk to all phones. |
167 | 176 |
168 Args: | 177 Args: |
169 options: options object | 178 options: options object |
170 test: An I_TEST namedtuple | 179 test: An I_TEST namedtuple |
171 print_step: Print a buildbot step | 180 print_step: Print a buildbot step |
172 """ | 181 """ |
173 if print_step: | 182 if print_step: |
174 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) | 183 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 279 |
271 # Device check and alert emails | 280 # Device check and alert emails |
272 buildbot_report.PrintNamedStep('device_status_check') | 281 buildbot_report.PrintNamedStep('device_status_check') |
273 RunCmd(['build/android/device_status_check.py'], halt_on_failure=True) | 282 RunCmd(['build/android/device_status_check.py'], halt_on_failure=True) |
274 | 283 |
275 # Provision devices | 284 # Provision devices |
276 buildbot_report.PrintNamedStep('provision_devices') | 285 buildbot_report.PrintNamedStep('provision_devices') |
277 target = options.factory_properties.get('target', 'Debug') | 286 target = options.factory_properties.get('target', 'Debug') |
278 RunCmd(['build/android/provision_devices.py', '-t', target]) | 287 RunCmd(['build/android/provision_devices.py', '-t', target]) |
279 | 288 |
| 289 # Check to see if devices can install apks. |
| 290 CheckInstall() |
| 291 |
280 if options.install: | 292 if options.install: |
281 test_obj = INSTRUMENTATION_TESTS[options.install] | 293 test_obj = INSTRUMENTATION_TESTS[options.install] |
282 InstallApk(options, test_obj, print_step=True) | 294 InstallApk(options, test_obj, print_step=True) |
283 | 295 |
284 if 'chromedriver' in options.test_filter: | 296 if 'chromedriver' in options.test_filter: |
285 RunChromeDriverTests() | 297 RunChromeDriverTests() |
286 if 'unit' in options.test_filter: | 298 if 'unit' in options.test_filter: |
287 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 299 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
288 if 'ui' in options.test_filter: | 300 if 'ui' in options.test_filter: |
289 for test in INSTRUMENTATION_TESTS.itervalues(): | 301 for test in INSTRUMENTATION_TESTS.itervalues(): |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 'slave', 'android')) | 380 'slave', 'android')) |
369 if os.path.exists(build_internal_android): | 381 if os.path.exists(build_internal_android): |
370 android_paths.insert(0, build_internal_android) | 382 android_paths.insert(0, build_internal_android) |
371 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) | 383 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) |
372 | 384 |
373 MainTestWrapper(options) | 385 MainTestWrapper(options) |
374 | 386 |
375 | 387 |
376 if __name__ == '__main__': | 388 if __name__ == '__main__': |
377 sys.exit(main(sys.argv)) | 389 sys.exit(main(sys.argv)) |
OLD | NEW |