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

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

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 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 | « build/android/buildbot/bb_device_status_check.py ('k') | build/android/cpufeatures.gypi » ('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 hashlib 8 import hashlib
9 import json 9 import json
10 import os 10 import os
11 import random 11 import random
12 import re 12 import re
13 import shutil 13 import shutil
14 import sys 14 import sys
15 15
16 import bb_utils 16 import bb_utils
17 import bb_annotations 17 import bb_annotations
18 18
19 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) 19 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
20 import provision_devices 20 import provision_devices
21 from pylib import android_commands
22 from pylib import constants 21 from pylib import constants
23 from pylib.device import device_utils 22 from pylib.device import device_utils
24 from pylib.gtest import gtest_config 23 from pylib.gtest import gtest_config
25 24
26 CHROME_SRC_DIR = bb_utils.CHROME_SRC 25 CHROME_SRC_DIR = bb_utils.CHROME_SRC
27 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR) 26 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR)
28 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR 27 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR
29 BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts' 28 BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts'
30 29
31 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') 30 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave')
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 '--update-log']) 207 '--update-log'])
209 208
210 def RunChromeProxyTests(options): 209 def RunChromeProxyTests(options):
211 """Run the chrome_proxy tests. 210 """Run the chrome_proxy tests.
212 211
213 Args: 212 Args:
214 options: options object. 213 options: options object.
215 """ 214 """
216 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) 215 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False)
217 args = ['--browser', 'android-chrome-shell'] 216 args = ['--browser', 'android-chrome-shell']
218 devices = android_commands.GetAttachedDevices() 217 devices = device_utils.DeviceUtils.HealthyDevices()
219 if devices: 218 if devices:
220 args = args + ['--device', devices[0]] 219 args = args + ['--device', devices[0].adb.GetDeviceSerial()]
221 bb_annotations.PrintNamedStep('chrome_proxy') 220 bb_annotations.PrintNamedStep('chrome_proxy')
222 RunCmd(['tools/chrome_proxy/run_tests'] + args) 221 RunCmd(['tools/chrome_proxy/run_tests'] + args)
223 222
224 223
225 def RunTelemetryTests(options, step_name, run_tests_path): 224 def RunTelemetryTests(options, step_name, run_tests_path):
226 """Runs either telemetry_perf_unittests or telemetry_unittests. 225 """Runs either telemetry_perf_unittests or telemetry_unittests.
227 226
228 Args: 227 Args:
229 options: options object. 228 options: options object.
230 step_name: either 'telemetry_unittests' or 'telemetry_perf_unittests' 229 step_name: either 'telemetry_unittests' or 'telemetry_perf_unittests'
231 run_tests_path: path to run_tests script (tools/perf/run_tests for 230 run_tests_path: path to run_tests script (tools/perf/run_tests for
232 perf_unittests and tools/telemetry/run_tests for 231 perf_unittests and tools/telemetry/run_tests for
233 telemetry_unittests) 232 telemetry_unittests)
234 """ 233 """
235 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) 234 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False)
236 args = ['--browser', 'android-chrome-shell'] 235 args = ['--browser', 'android-chrome-shell']
237 devices = android_commands.GetAttachedDevices() 236 devices = device_utils.DeviceUtils.HealthyDevices()
238 if devices: 237 if devices:
239 args = args + ['--device', 'android'] 238 args = args + ['--device', 'android']
240 bb_annotations.PrintNamedStep(step_name) 239 bb_annotations.PrintNamedStep(step_name)
241 RunCmd([run_tests_path] + args) 240 RunCmd([run_tests_path] + args)
242 241
243 242
244 def InstallApk(options, test, print_step=False): 243 def InstallApk(options, test, print_step=False):
245 """Install an apk to all phones. 244 """Install an apk to all phones.
246 245
247 Args: 246 Args:
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests']) 528 RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests'])
530 RunWebkitLint() 529 RunWebkitLint()
531 530
532 531
533 def RunGPUTests(options): 532 def RunGPUTests(options):
534 revision = _GetRevision(options) 533 revision = _GetRevision(options)
535 builder_name = options.build_properties.get('buildername', 'noname') 534 builder_name = options.build_properties.get('buildername', 'noname')
536 535
537 bb_annotations.PrintNamedStep('pixel_tests') 536 bb_annotations.PrintNamedStep('pixel_tests')
538 RunCmd(['content/test/gpu/run_gpu_test.py', 537 RunCmd(['content/test/gpu/run_gpu_test.py',
539 'pixel', 538 'pixel', '-v',
540 '--browser', 539 '--browser',
541 'android-content-shell', 540 'android-content-shell',
542 '--build-revision', 541 '--build-revision',
543 str(revision), 542 str(revision),
544 '--upload-refimg-to-cloud-storage', 543 '--upload-refimg-to-cloud-storage',
545 '--refimg-cloud-storage-bucket', 544 '--refimg-cloud-storage-bucket',
546 'chromium-gpu-archive/reference-images', 545 'chromium-gpu-archive/reference-images',
547 '--os-type', 546 '--os-type',
548 'android', 547 'android',
549 '--test-machine-name', 548 '--test-machine-name',
550 EscapeBuilderName(builder_name)]) 549 EscapeBuilderName(builder_name)])
551 550
552 bb_annotations.PrintNamedStep('webgl_conformance_tests') 551 bb_annotations.PrintNamedStep('webgl_conformance_tests')
553 RunCmd(['content/test/gpu/run_gpu_test.py', 552 RunCmd(['content/test/gpu/run_gpu_test.py', '-v',
554 '--browser=android-content-shell', 'webgl_conformance', 553 '--browser=android-content-shell', 'webgl_conformance',
555 '--webgl-conformance-version=1.0.1']) 554 '--webgl-conformance-version=1.0.1'])
556 555
557 bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests') 556 bb_annotations.PrintNamedStep('android_webview_webgl_conformance_tests')
558 RunCmd(['content/test/gpu/run_gpu_test.py', 557 RunCmd(['content/test/gpu/run_gpu_test.py', '-v',
559 '--browser=android-webview-shell', 'webgl_conformance', 558 '--browser=android-webview-shell', 'webgl_conformance',
560 '--webgl-conformance-version=1.0.1']) 559 '--webgl-conformance-version=1.0.1'])
561 560
562 bb_annotations.PrintNamedStep('gpu_rasterization_tests') 561 bb_annotations.PrintNamedStep('gpu_rasterization_tests')
563 RunCmd(['content/test/gpu/run_gpu_test.py', 562 RunCmd(['content/test/gpu/run_gpu_test.py',
564 'gpu_rasterization', 563 'gpu_rasterization', '-v',
565 '--browser', 564 '--browser',
566 'android-content-shell', 565 'android-content-shell',
567 '--build-revision', 566 '--build-revision',
568 str(revision), 567 str(revision),
569 '--test-machine-name', 568 '--test-machine-name',
570 EscapeBuilderName(builder_name)]) 569 EscapeBuilderName(builder_name)])
571 570
572 571
573 def RunPythonUnitTests(_options): 572 def RunPythonUnitTests(_options):
574 for suite in constants.PYTHON_UNIT_TEST_SUITES: 573 for suite in constants.PYTHON_UNIT_TEST_SUITES:
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 787
789 if options.coverage_bucket: 788 if options.coverage_bucket:
790 setattr(options, 'coverage_dir', 789 setattr(options, 'coverage_dir',
791 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) 790 os.path.join(CHROME_OUT_DIR, options.target, 'coverage'))
792 791
793 MainTestWrapper(options) 792 MainTestWrapper(options)
794 793
795 794
796 if __name__ == '__main__': 795 if __name__ == '__main__':
797 sys.exit(main(sys.argv)) 796 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/buildbot/bb_device_status_check.py ('k') | build/android/cpufeatures.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698