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

Side by Side Diff: scripts/slave/recipes/chromedriver/chromedriver_android.py

Issue 1274723004: Converted Android Chromedriver buildbot scripts to recipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from infra.libs.infra_types import freeze
6 from recipe_engine import recipe_api
7
8 DEPS = [
9 'adb',
10 'archive',
11 'bot_update',
12 'chromedriver',
13 'chromium',
14 'chromium_android',
15 'commit_position',
16 'gclient',
17 'platform',
18 'properties',
19 ]
20
21 BUILDERS = freeze({
22 'chromium.fyi': {
23 'Android ChromeDriver Tests (dbg)': {
24 'config': 'main_builder',
25 'target': 'Debug',
26 # Whether or not to update the test results log (Android only).
27 'update_log': True,
28 'android_packages': [
29 'chrome_shell',
30 'chrome_stable',
31 'chrome_beta',
32 'chromedriver_webview_shell',
33 ],
34 'install_apks': [
35 {
36 'name': 'ChromeShell.apk',
37 'package': 'org.chromium.chrome.shell',
samuong 2015/08/28 00:14:47 Don't forget we need to replace this with ChromePu
mikecase (-- gone --) 2016/04/04 21:46:42 Done.
38 },
39 {
40 'name': 'ChromeDriverWebViewShell.apk',
41 'package': 'org.chromium.chromedriver_webview_shell',
42 },
43 ]
44 },
45 },
46 })
47
48 REPO_URL = 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src'
49
50 def RunSteps(api):
51 mastername = api.properties['mastername']
52 buildername = api.properties['buildername']
53 builder = BUILDERS[mastername][buildername]
54 api.chromium_android.configure_from_properties(
55 builder['config'],
56 REPO_NAME='src',
57 REPO_URL=REPO_URL,
58 INTERNAL=False,
59 BUILD_CONFIG=builder['target'])
60 android_packages = builder.get('android_packages')
61 update_log = builder.get('update_log')
62 platform = api.chromedriver.get_chromedriver_platform(bool(android_packages))
63
64 api.gclient.set_config('chromium')
65 api.gclient.apply_config('android')
66 api.bot_update.ensure_checkout()
67 api.chromium_android.clean_local_files()
68 api.chromium.runhooks()
69 api.chromium_android.run_tree_truth()
70
71 api.adb.root_devices()
72 api.chromium_android.spawn_logcat_monitor()
73 api.chromium_android.device_status_check()
74 api.chromium_android.provision_devices(
75 min_battery_level=95, disable_network=True, disable_java_debug=True,
76 reboot_timeout=180)
77
78 api.archive.download_and_unzip_build(
79 step_name='extract build',
80 target=api.chromium.c.BUILD_CONFIG,
81 build_url=None,
82 build_archive_url=api.properties.get('parent_build_archive_url'))
83 commit_position = api.commit_position.parse_revision(
84 api.properties['got_revision_cp'])
85
86 if builder['install_apks']:
87 for apk in builder['install_apks']:
88 api.chromium_android.adb_install_apk(
89 apk['name'],
90 apk['package'])
91
92 api.chromedriver.download_prebuilts()
93 passed = api.chromedriver.run_all_tests(
94 android_packages=android_packages)
95 api.chromedriver.archive_server_logs()
96
97 if update_log:
98 api.chromedriver.update_test_results_log(platform, commit_position, passed)
99
100 api.chromium_android.logcat_dump()
101 api.chromium_android.stack_tool_steps()
102 api.chromium_android.test_report()
103
104 def GenTests(api):
105 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s)
106
107 yield (
108 api.test('%s_basic' % sanitize('Android ChromeDriver Tests (dbg)')) +
109 api.properties.generic(
110 buildername='Android ChromeDriver Tests (dbg)',
111 slavename='slavename',
112 mastername='chromium.fyi') +
113 api.properties(
114 parent_build_archive_url='gs://test-domain/test-archive.zip',
115 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
116 got_revision_cp='refs/heads/master@{#333333}'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698