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 hashlib | 8 import hashlib |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 suites: List of suite names to run. | 155 suites: List of suite names to run. |
156 suites_options: Command line options dictionary for particular suites. | 156 suites_options: Command line options dictionary for particular suites. |
157 For example, | 157 For example, |
158 {'content_browsertests', ['--num_retries=1', '--release']} | 158 {'content_browsertests', ['--num_retries=1', '--release']} |
159 will add the options only to content_browsertests. | 159 will add the options only to content_browsertests. |
160 """ | 160 """ |
161 | 161 |
162 if not suites_options: | 162 if not suites_options: |
163 suites_options = {} | 163 suites_options = {} |
164 | 164 |
165 args = ['--verbose'] | 165 args = ['--verbose', '--blacklist-file', 'out/bad_devices.json'] |
166 if options.target == 'Release': | 166 if options.target == 'Release': |
167 args.append('--release') | 167 args.append('--release') |
168 if options.asan: | 168 if options.asan: |
169 args.append('--tool=asan') | 169 args.append('--tool=asan') |
170 if options.gtest_filter: | 170 if options.gtest_filter: |
171 args.append('--gtest-filter=%s' % options.gtest_filter) | 171 args.append('--gtest-filter=%s' % options.gtest_filter) |
172 | 172 |
173 for suite in suites: | 173 for suite in suites: |
174 bb_annotations.PrintNamedStep(suite) | 174 bb_annotations.PrintNamedStep(suite) |
175 cmd = [suite] + args | 175 cmd = [suite] + args |
(...skipping 24 matching lines...) Expand all Loading... |
200 """Install an apk to all phones. | 200 """Install an apk to all phones. |
201 | 201 |
202 Args: | 202 Args: |
203 options: options object | 203 options: options object |
204 test: An I_TEST namedtuple | 204 test: An I_TEST namedtuple |
205 print_step: Print a buildbot step | 205 print_step: Print a buildbot step |
206 """ | 206 """ |
207 if print_step: | 207 if print_step: |
208 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) | 208 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) |
209 | 209 |
210 args = ['--apk_package', test.apk_package] | 210 args = [ |
| 211 '--apk_package', test.apk_package, |
| 212 '--blacklist-file', 'out/bad_devices.json', |
| 213 ] |
211 if options.target == 'Release': | 214 if options.target == 'Release': |
212 args.append('--release') | 215 args.append('--release') |
213 args.append(test.apk) | 216 args.append(test.apk) |
214 | 217 |
215 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) | 218 RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
216 | 219 |
217 | 220 |
218 def RunInstrumentationSuite(options, test, flunk_on_failure=True, | 221 def RunInstrumentationSuite(options, test, flunk_on_failure=True, |
219 python_only=False, official_build=False): | 222 python_only=False, official_build=False): |
220 """Manages an invocation of test_runner.py for instrumentation tests. | 223 """Manages an invocation of test_runner.py for instrumentation tests. |
221 | 224 |
222 Args: | 225 Args: |
223 options: options object | 226 options: options object |
224 test: An I_TEST namedtuple | 227 test: An I_TEST namedtuple |
225 flunk_on_failure: Flunk the step if tests fail. | 228 flunk_on_failure: Flunk the step if tests fail. |
226 Python: Run only host driven Python tests. | 229 Python: Run only host driven Python tests. |
227 official_build: Run official-build tests. | 230 official_build: Run official-build tests. |
228 """ | 231 """ |
229 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) | 232 bb_annotations.PrintNamedStep('%s_instrumentation_tests' % test.name.lower()) |
230 | 233 |
231 if test.apk: | 234 if test.apk: |
232 InstallApk(options, test) | 235 InstallApk(options, test) |
233 args = ['--test-apk', test.test_apk, '--verbose'] | 236 args = [ |
| 237 '--test-apk', test.test_apk, '--verbose', |
| 238 '--blacklist-file', 'out/bad_devices.json' |
| 239 ] |
234 if test.test_data: | 240 if test.test_data: |
235 args.extend(['--test_data', test.test_data]) | 241 args.extend(['--test_data', test.test_data]) |
236 if options.target == 'Release': | 242 if options.target == 'Release': |
237 args.append('--release') | 243 args.append('--release') |
238 if options.asan: | 244 if options.asan: |
239 args.append('--tool=asan') | 245 args.append('--tool=asan') |
240 if options.flakiness_server: | 246 if options.flakiness_server: |
241 args.append('--flakiness-dashboard-server=%s' % | 247 args.append('--flakiness-dashboard-server=%s' % |
242 options.flakiness_server) | 248 options.flakiness_server) |
243 if options.coverage_bucket: | 249 if options.coverage_bucket: |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 RunCmd(['sleep', '5']) | 433 RunCmd(['sleep', '5']) |
428 | 434 |
429 | 435 |
430 def ProvisionDevices(options): | 436 def ProvisionDevices(options): |
431 bb_annotations.PrintNamedStep('provision_devices') | 437 bb_annotations.PrintNamedStep('provision_devices') |
432 | 438 |
433 if not bb_utils.TESTING: | 439 if not bb_utils.TESTING: |
434 # Restart adb to work around bugs, sleep to wait for usb discovery. | 440 # Restart adb to work around bugs, sleep to wait for usb discovery. |
435 device_utils.RestartServer() | 441 device_utils.RestartServer() |
436 RunCmd(['sleep', '1']) | 442 RunCmd(['sleep', '1']) |
437 provision_cmd = ['build/android/provision_devices.py', '-t', options.target] | 443 provision_cmd = [ |
| 444 'build/android/provision_devices.py', '-t', options.target, |
| 445 '--blacklist-file', 'out/bad_devices.json' |
| 446 ] |
438 if options.auto_reconnect: | 447 if options.auto_reconnect: |
439 provision_cmd.append('--auto-reconnect') | 448 provision_cmd.append('--auto-reconnect') |
440 if options.skip_wipe: | 449 if options.skip_wipe: |
441 provision_cmd.append('--skip-wipe') | 450 provision_cmd.append('--skip-wipe') |
442 if options.disable_location: | 451 if options.disable_location: |
443 provision_cmd.append('--disable-location') | 452 provision_cmd.append('--disable-location') |
444 RunCmd(provision_cmd, halt_on_failure=True) | 453 RunCmd(provision_cmd, halt_on_failure=True) |
445 | 454 |
446 | 455 |
447 def DeviceStatusCheck(options): | 456 def DeviceStatusCheck(options): |
448 bb_annotations.PrintNamedStep('device_status_check') | 457 bb_annotations.PrintNamedStep('device_status_check') |
449 cmd = ['build/android/buildbot/bb_device_status_check.py'] | 458 cmd = [ |
| 459 'build/android/buildbot/bb_device_status_check.py', |
| 460 '--blacklist-file', 'out/bad_devices.json', |
| 461 ] |
450 if options.restart_usb: | 462 if options.restart_usb: |
451 cmd.append('--restart-usb') | 463 cmd.append('--restart-usb') |
452 RunCmd(cmd, halt_on_failure=True) | 464 RunCmd(cmd, halt_on_failure=True) |
453 | 465 |
454 | 466 |
455 def GetDeviceSetupStepCmds(): | 467 def GetDeviceSetupStepCmds(): |
456 return [ | 468 return [ |
457 ('device_status_check', DeviceStatusCheck), | 469 ('device_status_check', DeviceStatusCheck), |
458 ('provision_devices', ProvisionDevices), | 470 ('provision_devices', ProvisionDevices), |
459 ] | 471 ] |
(...skipping 27 matching lines...) Expand all Loading... |
487 '--browser', | 499 '--browser', |
488 'android-content-shell', | 500 'android-content-shell', |
489 '--build-revision', | 501 '--build-revision', |
490 str(revision), | 502 str(revision), |
491 '--upload-refimg-to-cloud-storage', | 503 '--upload-refimg-to-cloud-storage', |
492 '--refimg-cloud-storage-bucket', | 504 '--refimg-cloud-storage-bucket', |
493 'chromium-gpu-archive/reference-images', | 505 'chromium-gpu-archive/reference-images', |
494 '--os-type', | 506 '--os-type', |
495 'android', | 507 'android', |
496 '--test-machine-name', | 508 '--test-machine-name', |
497 EscapeBuilderName(builder_name)]) | 509 EscapeBuilderName(builder_name), |
| 510 '--android-blacklist-file', |
| 511 'out/bad_devices.json']) |
498 | 512 |
499 bb_annotations.PrintNamedStep('webgl_conformance_tests') | 513 bb_annotations.PrintNamedStep('webgl_conformance_tests') |
500 RunCmd(['content/test/gpu/run_gpu_test.py', '-v', | 514 RunCmd(['content/test/gpu/run_gpu_test.py', '-v', |
501 '--browser=android-content-shell', 'webgl_conformance', | 515 '--browser=android-content-shell', 'webgl_conformance', |
502 '--webgl-conformance-version=1.0.1']) | 516 '--webgl-conformance-version=1.0.1', |
| 517 '--android-blacklist-file', |
| 518 'out/bad_devices.json']) |
503 | 519 |
504 bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests') | 520 bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests') |
505 RunCmd(['content/test/gpu/run_gpu_test.py', '-v', | 521 RunCmd(['content/test/gpu/run_gpu_test.py', '-v', |
506 '--browser=android-webview-shell', 'webgl_conformance', | 522 '--browser=android-webview-shell', 'webgl_conformance', |
507 '--webgl-conformance-version=1.0.1']) | 523 '--webgl-conformance-version=1.0.1', |
| 524 '--android-blacklist-file', |
| 525 'out/bad_devices.json']) |
508 | 526 |
509 bb_annotations.PrintNamedStep('gpu_rasterization_tests') | 527 bb_annotations.PrintNamedStep('gpu_rasterization_tests') |
510 RunCmd(['content/test/gpu/run_gpu_test.py', | 528 RunCmd(['content/test/gpu/run_gpu_test.py', |
511 'gpu_rasterization', '-v', | 529 'gpu_rasterization', '-v', |
512 '--browser', | 530 '--browser', |
513 'android-content-shell', | 531 'android-content-shell', |
514 '--build-revision', | 532 '--build-revision', |
515 str(revision), | 533 str(revision), |
516 '--test-machine-name', | 534 '--test-machine-name', |
517 EscapeBuilderName(builder_name)]) | 535 EscapeBuilderName(builder_name), |
| 536 '--android-blacklist-file', |
| 537 'out/bad_devices.json']) |
518 | 538 |
519 | 539 |
520 def RunPythonUnitTests(_options): | 540 def RunPythonUnitTests(_options): |
521 for suite in constants.PYTHON_UNIT_TEST_SUITES: | 541 for suite in constants.PYTHON_UNIT_TEST_SUITES: |
522 bb_annotations.PrintNamedStep(suite) | 542 bb_annotations.PrintNamedStep(suite) |
523 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) | 543 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) |
524 | 544 |
525 | 545 |
526 def GetTestStepCmds(): | 546 def GetTestStepCmds(): |
527 return [ | 547 return [ |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 | 753 |
734 if options.coverage_bucket: | 754 if options.coverage_bucket: |
735 setattr(options, 'coverage_dir', | 755 setattr(options, 'coverage_dir', |
736 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 756 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
737 | 757 |
738 MainTestWrapper(options) | 758 MainTestWrapper(options) |
739 | 759 |
740 | 760 |
741 if __name__ == '__main__': | 761 if __name__ == '__main__': |
742 sys.exit(main(sys.argv)) | 762 sys.exit(main(sys.argv)) |
OLD | NEW |