Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 for suite in instrumentation_tests: | |
|
sky
2014/09/19 02:46:57
nit: you could shorten this and the next to someth
jam
2014/09/19 03:08:11
Done.
| |
| 138 test_names.append(suite['gyp_target']) | |
| 139 for suite, _ in unittests: | |
| 140 test_names.append(suite) | |
| 141 | |
| 142 compile_targets = api.chromium.c.compile_py.default_targets | |
| 143 api.filter.does_patch_require_compile( | |
| 144 exes=test_names, | |
| 145 compile_targets=compile_targets, | |
| 146 additional_name='chromium', | |
|
sky
2014/09/19 02:46:57
'chromium' picks up the blacklist used for win/lin
jam
2014/09/19 03:08:11
yep i want the chromium one, since there are (andr
| |
| 147 config_file_name='trybot_analyze_config.json') | |
| 148 if not api.filter.result: | |
| 149 return | |
| 150 compile_targets = list(set(compile_targets) & | |
| 151 set(api.filter.compile_targets)) | |
| 152 | |
| 122 api.chromium_android.run_tree_truth() | 153 api.chromium_android.run_tree_truth() |
| 123 api.chromium_android.compile() | 154 api.chromium_android.compile(targets=compile_targets) |
| 124 | 155 |
| 125 api.adb.root_devices() | 156 api.adb.root_devices() |
| 126 | 157 |
| 127 api.chromium_android.spawn_logcat_monitor() | 158 api.chromium_android.spawn_logcat_monitor() |
| 128 api.chromium_android.detect_and_setup_devices() | 159 api.chromium_android.detect_and_setup_devices() |
| 129 | 160 |
| 130 with api.step.defer_results(): | 161 with api.step.defer_results(): |
| 131 instrumentation_tests = bot_config.get('instrumentation_tests', []) | |
| 132 for suite in instrumentation_tests: | 162 for suite in instrumentation_tests: |
| 163 if is_trybot and not suite['gyp_target'] in api.filter.matching_exes: | |
|
sky
2014/09/19 02:46:57
Seems like this code would be easier to follow if
jam
2014/09/19 03:08:11
Done.
| |
| 164 continue | |
| 133 api.chromium_android.run_instrumentation_suite( | 165 api.chromium_android.run_instrumentation_suite( |
| 134 suite['test'], verbose=True, **suite.get('kwargs', {})) | 166 suite['test'], verbose=True, **suite.get('kwargs', {})) |
| 135 | 167 |
| 136 unittests = bot_config.get('unittests', []) | |
| 137 for suite, isolate_path in unittests: | 168 for suite, isolate_path in unittests: |
| 169 if is_trybot and not suite in api.filter.matching_exes: | |
| 170 continue | |
| 138 if isolate_path: | 171 if isolate_path: |
| 139 isolate_path = api.path['checkout'].join(*isolate_path) | 172 isolate_path = api.path['checkout'].join(*isolate_path) |
| 140 api.chromium_android.run_test_suite( | 173 api.chromium_android.run_test_suite( |
| 141 suite, | 174 suite, |
| 142 isolate_file_path=isolate_path) | 175 isolate_file_path=isolate_path) |
| 143 | 176 |
| 144 api.chromium_android.logcat_dump(gs_bucket='chromium-android') | 177 api.chromium_android.logcat_dump(gs_bucket='chromium-android') |
| 145 api.chromium_android.stack_tool_steps() | 178 api.chromium_android.stack_tool_steps() |
| 146 api.chromium_android.test_report() | 179 api.chromium_android.test_report() |
| 147 | 180 |
| 148 def GenTests(api): | 181 def GenTests(api): |
| 149 for mastername in BUILDERS: | 182 for mastername in BUILDERS: |
| 150 for buildername in BUILDERS[mastername]: | 183 for buildername in BUILDERS[mastername]: |
| 151 yield ( | 184 yield ( |
| 152 api.test(buildername) + | 185 api.test(buildername) + |
| 153 api.properties.generic( | 186 api.properties.generic( |
| 154 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', | 187 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 155 parent_buildername='parent_buildername', | 188 parent_buildername='parent_buildername', |
| 156 parent_buildnumber='1729', | 189 parent_buildnumber='1729', |
| 157 mastername=mastername, | 190 mastername=mastername, |
| 158 buildername=buildername, | 191 buildername=buildername, |
| 159 slavename='slavename', | 192 slavename='slavename', |
| 160 buildnumber='1337') | 193 buildnumber='1337') + |
| 194 api.override_step_data( | |
| 195 'analyze', | |
| 196 api.json.output({'status': 'Found dependency', | |
| 197 'targets': ['breakpad_unittests', | |
| 198 'chrome_shell_test_apk'], | |
| 199 'build_targets': ['breakpad_unittests', | |
| 200 'chrome_shell_test_apk']})) | |
| 161 ) | 201 ) |
| 162 | 202 |
| 163 yield ( | 203 yield ( |
| 164 api.test('android_dbg_tests_recipe__content_browsertests_failure') + | 204 api.test('android_dbg_tests_recipe__content_browsertests_failure') + |
| 165 api.properties.generic( | 205 api.properties.generic( |
| 166 mastername='tryserver.chromium.linux', | 206 mastername='tryserver.chromium.linux', |
| 167 buildername='android_dbg_tests_recipe', | 207 buildername='android_dbg_tests_recipe', |
| 168 slavename='slavename') + | 208 slavename='slavename') + |
| 209 api.override_step_data( | |
| 210 'analyze', | |
| 211 api.json.output({'status': 'Found dependency', | |
| 212 'targets': ['content_browsertests'], | |
| 213 'build_targets': ['content_browsertests']})) + | |
| 169 api.step_data('content_browsertests', retcode=1) | 214 api.step_data('content_browsertests', retcode=1) |
| 170 ) | 215 ) |
| 216 | |
| 217 # Tests analyze module early exits if patch can't affect this config. | |
| 218 yield ( | |
| 219 api.test('no_compile_because_of_analyze') + | |
| 220 api.properties.generic( | |
| 221 mastername='tryserver.chromium.linux', | |
| 222 buildername='android_dbg_tests_recipe', | |
| 223 slavename='slavename') + | |
| 224 api.override_step_data( | |
| 225 'analyze', | |
| 226 api.json.output({'status': 'No compile necessary'})) | |
| 227 ) | |
| OLD | NEW |