Chromium Code Reviews| Index: build/android/buildbot/bb_device_steps.py |
| diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py |
| index a1f1b7ff653f877a1ec497bd6e33b8066b236c1e..0ac4b76078f5aa16e5356368d1e1dee31fca9f35 100755 |
| --- a/build/android/buildbot/bb_device_steps.py |
| +++ b/build/android/buildbot/bb_device_steps.py |
| @@ -61,6 +61,7 @@ INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [ |
| VALID_TESTS = set(['chromedriver', 'ui', 'unit', 'webkit', 'webkit_layout']) |
| +NUM_CHECK_INSTALL = 3 |
| def SpawnCmd(command): |
| @@ -76,7 +77,7 @@ def SpawnCmd(command): |
| return subprocess.Popen(command, cwd=CHROME_SRC) |
| -def RunCmd(command, flunk_on_failure=True): |
| +def RunCmd(command, flunk_on_failure=True, halt_on_failure=False): |
| """Run a command relative to the chrome source root.""" |
| code = SpawnCmd(command).wait() |
| print '<', ' '.join(map(pipes.quote, command)) |
| @@ -86,6 +87,9 @@ def RunCmd(command, flunk_on_failure=True): |
| buildbot_report.PrintError() |
| else: |
| buildbot_report.PrintWarning() |
| + # Allow steps to have both halting (i.e. 1) and non-halting exit codes. |
| + if code != 0 and code != 88 and halt_on_failure: |
| + raise OSError() |
| return code |
| @@ -161,6 +165,15 @@ def RunChromeDriverTests(): |
| '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) |
| +def CheckInstall(): |
| + """Build bot step to see if adb install works on attached devices. """ |
| + buildbot_report.PrintNamedStep('Check device install') |
| + # This step checks if apks can be installed on the devices. |
| + args = ['--apk', 'build/android/CheckInstallApk-debug.apk'] |
| + for _ in range(NUM_CHECK_INSTALL): |
|
Isaac (away)
2013/05/07 18:08:47
Actually, why try to install multiple times?
If w
|
| + RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
| + |
| + |
| def InstallApk(options, test, print_step=False): |
| """Install an apk to all phones. |
| @@ -175,7 +188,7 @@ def InstallApk(options, test, print_step=False): |
| if options.target == 'Release': |
| args.append('--release') |
| - RunCmd(['build/android/adb_install_apk.py'] + args) |
| + RunCmd(['build/android/adb_install_apk.py'] + args, halt_on_failure=True) |
| def RunInstrumentationSuite(options, test): |
| @@ -269,13 +282,16 @@ def MainTestWrapper(options): |
| # Device check and alert emails |
| buildbot_report.PrintNamedStep('device_status_check') |
| - RunCmd(['build/android/device_status_check.py']) |
| + RunCmd(['build/android/device_status_check.py'], halt_on_failure=True) |
| # Provision devices |
| buildbot_report.PrintNamedStep('provision_devices') |
| target = options.factory_properties.get('target', 'Debug') |
| RunCmd(['build/android/provision_devices.py', '-t', target]) |
| + # Check to see if devices can install apks. |
| + CheckInstall() |
| + |
| if options.install: |
| test_obj = INSTRUMENTATION_TESTS[options.install] |
| InstallApk(options, test_obj, print_step=True) |