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

Side by Side Diff: scripts/slave/recipes/android/tester.py

Issue 583843002: Use analyze.py in Android trybots. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: sky comments Created 6 years, 3 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 | scripts/slave/recipes/android/tester.expected/android_dbg_tests_recipe.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'adb', 6 'adb',
7 'bot_update', 7 'bot_update',
8 'chromium',
8 'chromium_android', 9 'chromium_android',
10 'filter',
9 'gclient', 11 'gclient',
10 'json', 12 'json',
11 'path', 13 'path',
12 'properties', 14 'properties',
13 'step', 15 'step',
14 'tryserver', 16 'tryserver',
15 ] 17 ]
16 18
17 INSTRUMENTATION_TESTS = [ 19 INSTRUMENTATION_TESTS = [
18 { 20 {
19 'test': 'MojoTest', 21 'test': 'MojoTest',
22 'gyp_target': 'mojo_test_apk',
20 }, 23 },
21 { 24 {
22 'test': 'AndroidWebViewTest', 25 'test': 'AndroidWebViewTest',
26 'gyp_target': 'android_webview_test_apk',
23 'kwargs': { 27 'kwargs': {
24 'test_data': 'webview:android_webview/test/data/device_files', 28 'test_data': 'webview:android_webview/test/data/device_files',
25 'install_apk': { 29 'install_apk': {
26 'package': 'org.chromium.android_webview.shell', 30 'package': 'org.chromium.android_webview.shell',
27 'apk': 'AndroidWebView.apk' 31 'apk': 'AndroidWebView.apk'
28 }, 32 },
29 }, 33 },
30 }, 34 },
31 { 35 {
32 'test': 'ChromeShellTest', 36 'test': 'ChromeShellTest',
37 'gyp_target': 'chrome_shell_test_apk',
33 'kwargs': { 38 'kwargs': {
34 'test_data': 'chrome:chrome/test/data/android/device_files', 39 'test_data': 'chrome:chrome/test/data/android/device_files',
35 'install_apk': { 40 'install_apk': {
36 'package': 'org.chromium.chrome.shell', 41 'package': 'org.chromium.chrome.shell',
37 'apk': 'ChromeShell.apk', 42 'apk': 'ChromeShell.apk',
38 }, 43 },
39 # TODO(luqui): find out if host_driven_root is necessary 44 # TODO(luqui): find out if host_driven_root is necessary
40 }, 45 },
41 }, 46 },
42 { 47 {
43 'test': 'ContentShellTest', 48 'test': 'ContentShellTest',
49 'gyp_target': 'content_shell_test_apk',
44 'kwargs': { 50 'kwargs': {
45 'test_data': 'content:content/test/data/android/device_files', 51 'test_data': 'content:content/test/data/android/device_files',
46 'install_apk': { 52 'install_apk': {
47 'package': 'org.chromium.chontent_shell_apk', 53 'package': 'org.chromium.chontent_shell_apk',
48 'apk': 'ContentShell.apk', 54 'apk': 'ContentShell.apk',
49 }, 55 },
50 }, 56 },
51 }, 57 },
52 ] 58 ]
53 59
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 'config': 'main_builder', 96 'config': 'main_builder',
91 'instrumentation_tests': INSTRUMENTATION_TESTS, 97 'instrumentation_tests': INSTRUMENTATION_TESTS,
92 'unittests': TELEMETRY_UNIT_TESTS, 98 'unittests': TELEMETRY_UNIT_TESTS,
93 'target': 'Release', 99 'target': 'Release',
94 'try': True, 100 'try': True,
95 }, 101 },
96 } 102 }
97 } 103 }
98 104
99 def GenSteps(api): 105 def GenSteps(api):
106 # Required for us to be able to use filter.
107 api.chromium_android.set_config('base_config')
108
100 mastername = api.properties['mastername'] 109 mastername = api.properties['mastername']
101 buildername = api.properties['buildername'] 110 buildername = api.properties['buildername']
102 bot_config = BUILDERS[mastername][buildername] 111 bot_config = BUILDERS[mastername][buildername]
103 112
104 api.chromium_android.configure_from_properties( 113 api.chromium_android.configure_from_properties(
105 bot_config['config'], 114 bot_config['config'],
106 INTERNAL=False, 115 INTERNAL=False,
107 BUILD_CONFIG=bot_config['target'], 116 BUILD_CONFIG=bot_config['target'],
108 REPO_NAME='src', 117 REPO_NAME='src',
109 REPO_URL='svn://svn-mirror.golo.chromium.org/chrome/trunk/src') 118 REPO_URL='svn://svn-mirror.golo.chromium.org/chrome/trunk/src')
110 119
111 api.gclient.set_config('chromium') 120 api.gclient.set_config('chromium')
112 api.gclient.apply_config('android') 121 api.gclient.apply_config('android')
113 api.gclient.apply_config('chrome_internal') 122 api.gclient.apply_config('chrome_internal')
114 123
115 api.bot_update.ensure_checkout() 124 api.bot_update.ensure_checkout()
116 api.chromium_android.clean_local_files() 125 api.chromium_android.clean_local_files()
117 api.chromium_android.runhooks() 126 api.chromium_android.runhooks()
118 127
119 if bot_config.get('try', False): 128 compile_targets = None
129 instrumentation_tests = bot_config.get('instrumentation_tests', [])
130 unittests = bot_config.get('unittests', [])
131 is_trybot = bot_config.get('try', False)
132 if is_trybot:
120 api.tryserver.maybe_apply_issue() 133 api.tryserver.maybe_apply_issue()
121 134
135 # Early out if we haven't changed any relevant code.
136 test_names = []
137 test_names.extend([suite['gyp_target'] for suite in instrumentation_tests])
138 test_names.extend([suite for suite, _ in unittests])
139
140 compile_targets = api.chromium.c.compile_py.default_targets
141 api.filter.does_patch_require_compile(
142 exes=test_names,
143 compile_targets=compile_targets,
144 additional_name='chromium',
145 config_file_name='trybot_analyze_config.json')
146 if not api.filter.result:
147 return
148 compile_targets = list(set(compile_targets) &
sky 2014/09/19 15:23:02 Does this bot pass in 'all' as a compile target? I
jabdelmalek 2014/09/19 15:37:53 the bots don't pass in all. On 2014/09/19 15:23:0
149 set(api.filter.compile_targets))
150 instrumentation_tests = [i for i in instrumentation_tests if \
151 i['gyp_target'] in api.filter.matching_exes]
152 unittests = [i for i in unittests if i[0] in api.filter.matching_exes]
153
122 api.chromium_android.run_tree_truth() 154 api.chromium_android.run_tree_truth()
123 api.chromium_android.compile() 155 api.chromium_android.compile(targets=compile_targets)
124 156
125 api.adb.root_devices() 157 api.adb.root_devices()
126 158
127 api.chromium_android.spawn_logcat_monitor() 159 api.chromium_android.spawn_logcat_monitor()
128 api.chromium_android.detect_and_setup_devices() 160 api.chromium_android.detect_and_setup_devices()
129 161
130 with api.step.defer_results(): 162 with api.step.defer_results():
131 instrumentation_tests = bot_config.get('instrumentation_tests', [])
132 for suite in instrumentation_tests: 163 for suite in instrumentation_tests:
133 api.chromium_android.run_instrumentation_suite( 164 api.chromium_android.run_instrumentation_suite(
134 suite['test'], verbose=True, **suite.get('kwargs', {})) 165 suite['test'], verbose=True, **suite.get('kwargs', {}))
135 166
136 unittests = bot_config.get('unittests', [])
137 for suite, isolate_path in unittests: 167 for suite, isolate_path in unittests:
138 if isolate_path: 168 if isolate_path:
139 isolate_path = api.path['checkout'].join(*isolate_path) 169 isolate_path = api.path['checkout'].join(*isolate_path)
140 api.chromium_android.run_test_suite( 170 api.chromium_android.run_test_suite(
141 suite, 171 suite,
142 isolate_file_path=isolate_path) 172 isolate_file_path=isolate_path)
143 173
144 api.chromium_android.logcat_dump(gs_bucket='chromium-android') 174 api.chromium_android.logcat_dump(gs_bucket='chromium-android')
145 api.chromium_android.stack_tool_steps() 175 api.chromium_android.stack_tool_steps()
146 api.chromium_android.test_report() 176 api.chromium_android.test_report()
147 177
148 def GenTests(api): 178 def GenTests(api):
149 for mastername in BUILDERS: 179 for mastername in BUILDERS:
150 for buildername in BUILDERS[mastername]: 180 for buildername in BUILDERS[mastername]:
151 yield ( 181 yield (
152 api.test(buildername) + 182 api.test(buildername) +
153 api.properties.generic( 183 api.properties.generic(
154 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', 184 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
155 parent_buildername='parent_buildername', 185 parent_buildername='parent_buildername',
156 parent_buildnumber='1729', 186 parent_buildnumber='1729',
157 mastername=mastername, 187 mastername=mastername,
158 buildername=buildername, 188 buildername=buildername,
159 slavename='slavename', 189 slavename='slavename',
160 buildnumber='1337') 190 buildnumber='1337') +
191 api.override_step_data(
192 'analyze',
193 api.json.output({'status': 'Found dependency',
194 'targets': ['breakpad_unittests',
195 'chrome_shell_test_apk'],
196 'build_targets': ['breakpad_unittests',
197 'chrome_shell_test_apk']}))
161 ) 198 )
162 199
163 yield ( 200 yield (
164 api.test('android_dbg_tests_recipe__content_browsertests_failure') + 201 api.test('android_dbg_tests_recipe__content_browsertests_failure') +
165 api.properties.generic( 202 api.properties.generic(
166 mastername='tryserver.chromium.linux', 203 mastername='tryserver.chromium.linux',
167 buildername='android_dbg_tests_recipe', 204 buildername='android_dbg_tests_recipe',
168 slavename='slavename') + 205 slavename='slavename') +
206 api.override_step_data(
207 'analyze',
208 api.json.output({'status': 'Found dependency',
209 'targets': ['content_browsertests'],
210 'build_targets': ['content_browsertests']})) +
169 api.step_data('content_browsertests', retcode=1) 211 api.step_data('content_browsertests', retcode=1)
170 ) 212 )
213
214 # Tests analyze module early exits if patch can't affect this config.
215 yield (
216 api.test('no_compile_because_of_analyze') +
217 api.properties.generic(
218 mastername='tryserver.chromium.linux',
219 buildername='android_dbg_tests_recipe',
220 slavename='slavename') +
221 api.override_step_data(
222 'analyze',
223 api.json.output({'status': 'No compile necessary'}))
224 )
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/android/tester.expected/android_dbg_tests_recipe.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698