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

Side by Side Diff: scripts/slave/recipes/emulator.py

Issue 1904493004: Reland #4 of Switch Android gtests to use generated wrapper scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 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 from recipe_engine import recipe_api 5 from recipe_engine import recipe_api
6 from recipe_engine.recipe_api import Property 6 from recipe_engine.recipe_api import Property
7 from recipe_engine.types import freeze 7 from recipe_engine.types import freeze
8 8
9 DEPS = [ 9 DEPS = [
10 'depot_tools/bot_update', 10 'depot_tools/bot_update',
11 'chromium', 11 'chromium',
12 'chromium_android', 12 'chromium_android',
13 'emulator', 13 'emulator',
14 'depot_tools/gclient', 14 'depot_tools/gclient',
15 'recipe_engine/path', 15 'recipe_engine/path',
16 'recipe_engine/properties', 16 'recipe_engine/properties',
17 'recipe_engine/step', 17 'recipe_engine/step',
18 ] 18 ]
19 19
20 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' 20 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git'
21 21
22 UNITTESTS = freeze([ 22 UNITTESTS = freeze([
23 ['android_webview_unittests', None], 23 'android_webview_unittests',
24 ['base_unittests', ['base', 'base_unittests.isolate']], 24 'base_unittests',
25 ['cc_unittests', None], 25 'cc_unittests',
26 ['components_unittests', ['components', 'components_unittests.isolate']], 26 'components_unittests',
27 ['events_unittests', None], 27 'events_unittests',
28 ['gl_tests', None], 28 'gl_tests',
29 ['ipc_tests', None], 29 'ipc_tests',
30 ['skia_unittests', None], 30 'skia_unittests',
31 ['sql_unittests', ['sql', 'sql_unittests.isolate']], 31 'sql_unittests',
32 ['sync_unit_tests', ['sync', 'sync_unit_tests.isolate']], 32 'sync_unit_tests',
33 ['ui_android_unittests', None], 33 'ui_android_unittests',
34 ['ui_touch_selection_unittests', None], 34 'ui_touch_selection_unittests',
35 ]) 35 ])
36 36
37 BUILDERS = freeze({ 37 BUILDERS = freeze({
38 'chromium.fyi':{ 38 'chromium.fyi':{
39 'Android Tests (x86 emulator)': { 39 'Android Tests (x86 emulator)': {
40 'config': 'x86_builder_mb', 40 'config': 'x86_builder_mb',
41 'target': 'Debug', 41 'target': 'Debug',
42 'abi': 'x86', 42 'abi': 'x86',
43 'api_level': 23, 43 'api_level': 23,
44 'unittests': UNITTESTS, 44 'unittests': UNITTESTS,
(...skipping 23 matching lines...) Expand all
68 api.emulator.set_config('base_config') 68 api.emulator.set_config('base_config')
69 69
70 api.bot_update.ensure_checkout() 70 api.bot_update.ensure_checkout()
71 api.chromium_android.clean_local_files() 71 api.chromium_android.clean_local_files()
72 api.chromium.runhooks() 72 api.chromium.runhooks()
73 73
74 if api.chromium.c.project_generator.tool == 'mb': 74 if api.chromium.c.project_generator.tool == 'mb':
75 api.chromium.run_mb(mastername, buildername, use_goma=True) 75 api.chromium.run_mb(mastername, buildername, use_goma=True)
76 76
77 targets = [] 77 targets = []
78 for target, _ in builder.get('unittests', []): 78 for target in builder.get('unittests', []):
79 # TODO(agrieve): Remove _apk suffix in favour of bin/run_${target} once GYP
80 # is gone. http://crbug.com/599919
79 targets.append(target + '_apk') 81 targets.append(target + '_apk')
80 api.chromium.compile(targets=targets) 82 api.chromium.compile(targets=targets)
81 83
82 api.emulator.install_emulator_deps(api_level=builder.get('api_level')) 84 api.emulator.install_emulator_deps(api_level=builder.get('api_level'))
83 85
84 provision_settings = builder.get('provision_provision_settings', {}) 86 provision_settings = builder.get('provision_provision_settings', {})
85 87
86 default_emulator_amount = 1 88 default_emulator_amount = 1
87 with api.emulator.launch_emulator( 89 with api.emulator.launch_emulator(
88 abi=builder.get('abi'), 90 abi=builder.get('abi'),
89 api_level=builder.get('api_level'), 91 api_level=builder.get('api_level'),
90 amount=builder.get('amount', default_emulator_amount), 92 amount=builder.get('amount', default_emulator_amount),
91 partition_size=builder.get('partition_size'), 93 partition_size=builder.get('partition_size'),
92 sdcard_size=builder.get('sdcard_size')): 94 sdcard_size=builder.get('sdcard_size')):
93 api.emulator.wait_for_emulator(builder.get('amount', 95 api.emulator.wait_for_emulator(builder.get('amount',
94 default_emulator_amount)) 96 default_emulator_amount))
95 api.chromium_android.spawn_logcat_monitor() 97 api.chromium_android.spawn_logcat_monitor()
96 api.chromium_android.provision_devices(emulators=True, **provision_settings) 98 api.chromium_android.provision_devices(emulators=True, **provision_settings)
97 99
98 try: 100 try:
99 with api.step.defer_results(): 101 with api.step.defer_results():
100 for suite, isolate_file in builder.get('unittests', []): 102 for suite in builder.get('unittests', []):
101 isolate_file_path = ( 103 api.chromium_android.run_test_suite(suite)
102 api.path['checkout'].join(*isolate_file)
103 if isolate_file else None)
104 api.chromium_android.run_test_suite(
105 suite, isolate_file_path=isolate_file_path)
106 finally: 104 finally:
107 api.chromium_android.logcat_dump() 105 api.chromium_android.logcat_dump()
108 api.chromium_android.stack_tool_steps() 106 api.chromium_android.stack_tool_steps()
109 api.chromium_android.test_report() 107 api.chromium_android.test_report()
110 108
111 def GenTests(api): 109 def GenTests(api):
112 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) 110 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s)
113 111
114 for mastername in BUILDERS: 112 for mastername in BUILDERS:
115 master = BUILDERS[mastername] 113 master = BUILDERS[mastername]
116 for buildername in master: 114 for buildername in master:
117 yield ( 115 yield (
118 api.test('%s_test_basic' % sanitize(buildername)) + 116 api.test('%s_test_basic' % sanitize(buildername)) +
119 api.properties.generic( 117 api.properties.generic(
120 buildername=buildername, 118 buildername=buildername,
121 mastername=mastername)) 119 mastername=mastername))
122 120
123 yield ( 121 yield (
124 api.test('Android_Tests__x86_emulator__test_fail') + 122 api.test('Android_Tests__x86_emulator__test_fail') +
125 api.properties.generic( 123 api.properties.generic(
126 buildername='Android Tests (x86 emulator)', 124 buildername='Android Tests (x86 emulator)',
127 mastername='chromium.fyi') + 125 mastername='chromium.fyi') +
128 api.step_data('android_webview_unittests', retcode=2) 126 api.step_data('android_webview_unittests', retcode=2)
129 ) 127 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698