Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2811)

Side by Side Diff: build/android/buildbot/bb_device_steps.py

Issue 16110005: Track install speed on devices and fail device status step on low battery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move check install into device status check and fail on low battery. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/android/device_status_check.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
174 def InstallApk(options, test, print_step=False): 165 def InstallApk(options, test, print_step=False):
175 """Install an apk to all phones. 166 """Install an apk to all phones.
176 167
177 Args: 168 Args:
178 options: options object 169 options: options object
179 test: An I_TEST namedtuple 170 test: An I_TEST namedtuple
180 print_step: Print a buildbot step 171 print_step: Print a buildbot step
181 """ 172 """
182 if print_step: 173 if print_step:
183 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) 174 buildbot_report.PrintNamedStep('install_%s' % test.name.lower())
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 270
280 # Device check and alert emails 271 # Device check and alert emails
281 buildbot_report.PrintNamedStep('device_status_check') 272 buildbot_report.PrintNamedStep('device_status_check')
282 RunCmd(['build/android/device_status_check.py'], halt_on_failure=True) 273 RunCmd(['build/android/device_status_check.py'], halt_on_failure=True)
283 274
284 # Provision devices 275 # Provision devices
285 buildbot_report.PrintNamedStep('provision_devices') 276 buildbot_report.PrintNamedStep('provision_devices')
286 target = options.factory_properties.get('target', 'Debug') 277 target = options.factory_properties.get('target', 'Debug')
287 RunCmd(['build/android/provision_devices.py', '-t', target]) 278 RunCmd(['build/android/provision_devices.py', '-t', target])
288 279
289 # Check to see if devices can install apks.
290 CheckInstall()
291
292 if options.install: 280 if options.install:
293 test_obj = INSTRUMENTATION_TESTS[options.install] 281 test_obj = INSTRUMENTATION_TESTS[options.install]
294 InstallApk(options, test_obj, print_step=True) 282 InstallApk(options, test_obj, print_step=True)
295 283
296 if 'chromedriver' in options.test_filter: 284 if 'chromedriver' in options.test_filter:
297 RunChromeDriverTests() 285 RunChromeDriverTests()
298 if 'unit' in options.test_filter: 286 if 'unit' in options.test_filter:
299 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) 287 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES)
300 if 'ui' in options.test_filter: 288 if 'ui' in options.test_filter:
301 for test in INSTRUMENTATION_TESTS.itervalues(): 289 for test in INSTRUMENTATION_TESTS.itervalues():
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 'slave', 'android')) 368 'slave', 'android'))
381 if os.path.exists(build_internal_android): 369 if os.path.exists(build_internal_android):
382 android_paths.insert(0, build_internal_android) 370 android_paths.insert(0, build_internal_android)
383 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) 371 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']])
384 372
385 MainTestWrapper(options) 373 MainTestWrapper(options)
386 374
387 375
388 if __name__ == '__main__': 376 if __name__ == '__main__':
389 sys.exit(main(sys.argv)) 377 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | build/android/device_status_check.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698