OLD | NEW |
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', | 23 ['android_webview_unittests', None], |
24 'base_unittests', | 24 ['base_unittests', ['base', 'base_unittests.isolate']], |
25 'cc_unittests', | 25 ['cc_unittests', None], |
26 'components_unittests', | 26 ['components_unittests', ['components', 'components_unittests.isolate']], |
27 'events_unittests', | 27 ['events_unittests', None], |
28 'gl_tests', | 28 ['gl_tests', None], |
29 'ipc_tests', | 29 ['ipc_tests', None], |
30 'skia_unittests', | 30 ['skia_unittests', None], |
31 'sql_unittests', | 31 ['sql_unittests', ['sql', 'sql_unittests.isolate']], |
32 'sync_unit_tests', | 32 ['sync_unit_tests', ['sync', 'sync_unit_tests.isolate']], |
33 'ui_android_unittests', | 33 ['ui_android_unittests', None], |
34 'ui_touch_selection_unittests', | 34 ['ui_touch_selection_unittests', None], |
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 Loading... |
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 the _apk entry once GYP is gone. | |
80 targets.append(target + '_apk') | 79 targets.append(target + '_apk') |
81 targets.append('bin/run_%s' % target) | |
82 api.chromium.compile(targets=targets) | 80 api.chromium.compile(targets=targets) |
83 | 81 |
84 api.emulator.install_emulator_deps(api_level=builder.get('api_level')) | 82 api.emulator.install_emulator_deps(api_level=builder.get('api_level')) |
85 | 83 |
86 provision_settings = builder.get('provision_provision_settings', {}) | 84 provision_settings = builder.get('provision_provision_settings', {}) |
87 | 85 |
88 default_emulator_amount = 1 | 86 default_emulator_amount = 1 |
89 with api.emulator.launch_emulator( | 87 with api.emulator.launch_emulator( |
90 abi=builder.get('abi'), | 88 abi=builder.get('abi'), |
91 api_level=builder.get('api_level'), | 89 api_level=builder.get('api_level'), |
92 amount=builder.get('amount', default_emulator_amount), | 90 amount=builder.get('amount', default_emulator_amount), |
93 partition_size=builder.get('partition_size'), | 91 partition_size=builder.get('partition_size'), |
94 sdcard_size=builder.get('sdcard_size')): | 92 sdcard_size=builder.get('sdcard_size')): |
95 api.emulator.wait_for_emulator(builder.get('amount', | 93 api.emulator.wait_for_emulator(builder.get('amount', |
96 default_emulator_amount)) | 94 default_emulator_amount)) |
97 api.chromium_android.spawn_logcat_monitor() | 95 api.chromium_android.spawn_logcat_monitor() |
98 api.chromium_android.provision_devices(emulators=True, **provision_settings) | 96 api.chromium_android.provision_devices(emulators=True, **provision_settings) |
99 | 97 |
100 try: | 98 try: |
101 with api.step.defer_results(): | 99 with api.step.defer_results(): |
102 for suite in builder.get('unittests', []): | 100 for suite, isolate_file in builder.get('unittests', []): |
103 api.chromium_android.run_test_suite(suite) | 101 isolate_file_path = ( |
| 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) |
104 finally: | 106 finally: |
105 api.chromium_android.logcat_dump() | 107 api.chromium_android.logcat_dump() |
106 api.chromium_android.stack_tool_steps() | 108 api.chromium_android.stack_tool_steps() |
107 api.chromium_android.test_report() | 109 api.chromium_android.test_report() |
108 | 110 |
109 def GenTests(api): | 111 def GenTests(api): |
110 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) | 112 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) |
111 | 113 |
112 for mastername in BUILDERS: | 114 for mastername in BUILDERS: |
113 master = BUILDERS[mastername] | 115 master = BUILDERS[mastername] |
114 for buildername in master: | 116 for buildername in master: |
115 yield ( | 117 yield ( |
116 api.test('%s_test_basic' % sanitize(buildername)) + | 118 api.test('%s_test_basic' % sanitize(buildername)) + |
117 api.properties.generic( | 119 api.properties.generic( |
118 buildername=buildername, | 120 buildername=buildername, |
119 mastername=mastername)) | 121 mastername=mastername)) |
120 | 122 |
121 yield ( | 123 yield ( |
122 api.test('Android_Tests__x86_emulator__test_fail') + | 124 api.test('Android_Tests__x86_emulator__test_fail') + |
123 api.properties.generic( | 125 api.properties.generic( |
124 buildername='Android Tests (x86 emulator)', | 126 buildername='Android Tests (x86 emulator)', |
125 mastername='chromium.fyi') + | 127 mastername='chromium.fyi') + |
126 api.step_data('android_webview_unittests', retcode=2) | 128 api.step_data('android_webview_unittests', retcode=2) |
127 ) | 129 ) |
OLD | NEW |