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..cca17d39fd8aca2c945c03cd04bd2b1cf2631d42 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 == 1 and halt_on_failure: |
|
Isaac (away)
2013/04/30 20:01:16
How about if "code != 88"
navabi
2013/04/30 21:41:46
Done (assuming you mean != 88 and != 0).
|
| + exit(1) |
|
Isaac (away)
2013/04/30 20:01:16
How about an exception instead of sys.exit:
raise
Isaac (away)
2013/04/30 20:03:38
actually looks like that exception takes arguments
navabi
2013/04/30 21:41:46
Done.
|
| return code |
| @@ -161,6 +165,18 @@ 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. The apk installed |
| + # is not important. SDK Controller is checked out as part of the Android SDK. |
| + args = ['--apk', |
| + 'third_party/android_tools/sdk/tools/apps/SdkController/bin/' |
| + 'SdkControllerApp.apk'] |
| + for _ in range(NUM_CHECK_INSTALL): |
| + 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 +191,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) |
|
navabi
2013/04/27 00:25:46
This will make the build stop if an apk install fa
Isaac (away)
2013/04/30 20:01:16
I'm confused why this isn't sufficient -- why do w
navabi
2013/04/30 21:41:46
Because not all test suites install apk's with adb
navabi
2013/04/30 21:43:55
For more information see the Note on the comment a
Isaac (away)
2013/04/30 21:53:17
That makes sense. Maybe in those cases we could ch
|
| def RunInstrumentationSuite(options, test): |
| @@ -269,13 +285,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) |
|
Isaac (away)
2013/04/30 21:53:17
devise_status_check returns error codes on things
navabi
2013/04/30 21:59:56
I don't think that is the case. The main function
Isaac (away)
2013/04/30 22:07:08
Sorry, yes you're right. I forgot Siva changed th
|
| # 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) |