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 from infra.libs.infra_types import freeze | 5 from infra.libs.infra_types import freeze, thaw |
6 | 6 |
7 DEPS = [ | 7 DEPS = [ |
8 'adb', | 8 'adb', |
9 'bot_update', | 9 'bot_update', |
10 'chromium', | 10 'chromium', |
11 'chromium_android', | 11 'chromium_android', |
| 12 'chromium_tests', |
12 'gclient', | 13 'gclient', |
13 'json', | 14 'json', |
14 'step', | 15 'step', |
15 'path', | 16 'path', |
16 'properties', | 17 'properties', |
| 18 'python', |
17 ] | 19 ] |
18 | 20 |
19 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' | 21 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' |
20 | 22 |
21 BUILDERS = freeze({ | 23 BUILDERS = freeze({ |
22 'chromium.perf': { | 24 'chromium.perf': { |
23 'Android Nexus4 Perf': { | 25 'Android Nexus4 Perf': { |
24 'perf_id': 'android-nexus4', | 26 'perf_id': 'android-nexus4', |
25 'bucket': 'chrome-perf', | 27 'bucket': 'chrome-perf', |
26 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 28 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
27 api.properties['parent_revision']), | 29 api.properties['parent_revision']), |
28 'num_device_shards': 8, | 30 'num_device_shards': 8, |
| 31 'test_spec_file': 'chromium.perf.json', |
29 }, | 32 }, |
30 'Android Nexus5 Perf': { | 33 'Android Nexus5 Perf': { |
31 'perf_id': 'android-nexus5', | 34 'perf_id': 'android-nexus5', |
32 'bucket': 'chrome-perf', | 35 'bucket': 'chrome-perf', |
33 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 36 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
34 api.properties['parent_revision']), | 37 api.properties['parent_revision']), |
35 'num_device_shards': 8, | 38 'num_device_shards': 8, |
| 39 'test_spec_file': 'chromium.perf.json', |
36 }, | 40 }, |
37 'Android Nexus7v2 Perf': { | 41 'Android Nexus7v2 Perf': { |
38 'perf_id': 'android-nexus7v2', | 42 'perf_id': 'android-nexus7v2', |
39 'bucket': 'chrome-perf', | 43 'bucket': 'chrome-perf', |
40 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 44 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
41 api.properties['parent_revision']), | 45 api.properties['parent_revision']), |
42 'num_device_shards': 8, | 46 'num_device_shards': 8, |
| 47 'test_spec_file': 'chromium.perf.json', |
43 }, | 48 }, |
44 'Android Nexus10 Perf': { | 49 'Android Nexus10 Perf': { |
45 'perf_id': 'android-nexus10', | 50 'perf_id': 'android-nexus10', |
46 'bucket': 'chrome-perf', | 51 'bucket': 'chrome-perf', |
47 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 52 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
48 api.properties['parent_revision']), | 53 api.properties['parent_revision']), |
49 'num_device_shards': 8, | 54 'num_device_shards': 8, |
| 55 'test_spec_file': 'chromium.perf.json', |
50 }, | 56 }, |
51 'Android MotoE Perf': { | 57 'Android MotoE Perf': { |
52 'perf_id': 'android-motoe', | 58 'perf_id': 'android-motoe', |
53 'bucket': 'chrome-perf', | 59 'bucket': 'chrome-perf', |
54 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 60 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
55 api.properties['parent_revision']), | 61 api.properties['parent_revision']), |
56 'num_device_shards': 8, | 62 'num_device_shards': 8, |
| 63 'test_spec_file': 'chromium.perf.json', |
57 }, | 64 }, |
58 }, | 65 }, |
59 'chromium.perf.fyi': { | 66 'chromium.perf.fyi': { |
60 'android_nexus5_oilpan_perf': { | 67 'android_nexus5_oilpan_perf': { |
61 'perf_id': 'android-nexus5-oilpan', | 68 'perf_id': 'android-nexus5-oilpan', |
62 'bucket': 'chromium-android', | 69 'bucket': 'chromium-android', |
63 'path': lambda api: ( | 70 'path': lambda api: ( |
64 '%s/build_product_%s.zip' % ( | 71 '%s/build_product_%s.zip' % ( |
65 api.properties['parent_buildername'], | 72 api.properties['parent_buildername'], |
66 api.properties['parent_revision'])), | 73 api.properties['parent_revision'])), |
(...skipping 13 matching lines...) Expand all Loading... |
80 api.properties['parent_revision']), | 87 api.properties['parent_revision']), |
81 'num_device_shards': 1, | 88 'num_device_shards': 1, |
82 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, | 89 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, |
83 }, | 90 }, |
84 }, | 91 }, |
85 }) | 92 }) |
86 | 93 |
87 def GenSteps(api): | 94 def GenSteps(api): |
88 mastername = api.properties['mastername'] | 95 mastername = api.properties['mastername'] |
89 buildername = api.properties['buildername'] | 96 buildername = api.properties['buildername'] |
90 builder = BUILDERS[mastername][buildername] | 97 builder = thaw(BUILDERS[mastername][buildername]) |
91 api.chromium_android.configure_from_properties('base_config', | 98 api.chromium_android.configure_from_properties('base_config', |
92 REPO_NAME='src', | 99 REPO_NAME='src', |
93 REPO_URL=REPO_URL, | 100 REPO_URL=REPO_URL, |
94 INTERNAL=False, | 101 INTERNAL=False, |
95 BUILD_CONFIG='Release') | 102 BUILD_CONFIG='Release', |
| 103 TARGET_PLATFORM='android') |
96 api.gclient.set_config('perf') | 104 api.gclient.set_config('perf') |
97 api.gclient.apply_config('android') | 105 api.gclient.apply_config('android') |
98 for c in builder.get('gclient_apply_config', []): | 106 for c in builder.get('gclient_apply_config', []): |
99 api.gclient.apply_config(c) | 107 api.gclient.apply_config(c) |
100 | 108 |
101 if builder.get('set_component_rev'): | 109 if builder.get('set_component_rev'): |
102 # If this is a component build and the main revision is e.g. blink, | 110 # If this is a component build and the main revision is e.g. blink, |
103 # webrtc, or v8, the custom deps revision of this component must be | 111 # webrtc, or v8, the custom deps revision of this component must be |
104 # dynamically set to either: | 112 # dynamically set to either: |
105 # (1) the revision of the builder, | 113 # (1) the revision of the builder, |
106 # (2) 'revision' from the waterfall, or | 114 # (2) 'revision' from the waterfall, or |
107 # (3) 'HEAD' for forced builds with unspecified 'revision'. | 115 # (3) 'HEAD' for forced builds with unspecified 'revision'. |
108 # TODO(machenbach): Use parent_got_cr_revision on testers with component | 116 # TODO(machenbach): Use parent_got_cr_revision on testers with component |
109 # builds to match also the chromium revision from the builder. | 117 # builds to match also the chromium revision from the builder. |
110 component_rev = api.properties.get( | 118 component_rev = api.properties.get( |
111 'parent_got_revision', api.properties.get('revision') or 'HEAD') | 119 'parent_got_revision', api.properties.get('revision') or 'HEAD') |
112 dep = builder.get('set_component_rev') | 120 dep = builder.get('set_component_rev') |
113 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev | 121 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev |
114 | 122 |
115 api.bot_update.ensure_checkout() | 123 api.bot_update.ensure_checkout() |
| 124 |
| 125 test_spec_file = builder.get('test_spec_file') |
| 126 test_spec = {} |
| 127 if test_spec_file: |
| 128 test_spec = api.chromium_tests.read_test_spec(api, test_spec_file) |
| 129 |
| 130 scripts_compile_targets = \ |
| 131 api.chromium.get_compile_targets_for_scripts().json.output |
| 132 |
| 133 builder['tests'] = api.chromium_tests.generate_tests_from_test_spec( |
| 134 api, test_spec, builder, buildername, mastername, False, |
| 135 scripts_compile_targets, [api.chromium.steps.generate_script]) |
| 136 |
116 api.path['checkout'] = api.path['slave_build'].join('src') | 137 api.path['checkout'] = api.path['slave_build'].join('src') |
117 api.chromium_android.clean_local_files() | 138 api.chromium_android.clean_local_files() |
118 | 139 |
119 api.chromium_android.download_build(bucket=builder['bucket'], | 140 api.chromium_android.download_build(bucket=builder['bucket'], |
120 path=builder['path'](api)) | 141 path=builder['path'](api)) |
121 | 142 |
122 api.chromium_android.common_tests_setup_steps(perf_setup=True) | 143 api.chromium_android.common_tests_setup_steps(perf_setup=True) |
123 | 144 |
124 api.chromium_android.adb_install_apk( | 145 api.chromium_android.adb_install_apk( |
125 'ChromeShell.apk', | 146 'ChromeShell.apk', |
126 'org.chromium.chrome.shell') | 147 'org.chromium.chrome.shell') |
127 | 148 |
| 149 test_runner = api.chromium_tests.create_test_runner( |
| 150 api, builder.get('tests', [])) |
| 151 |
128 perf_tests = api.chromium.list_perf_tests( | 152 perf_tests = api.chromium.list_perf_tests( |
129 browser='android-chrome-shell', | 153 browser='android-chrome-shell', |
130 num_shards=builder['num_device_shards'], | 154 num_shards=builder['num_device_shards'], |
131 devices=api.chromium_android.devices[0:1]).json.output | 155 devices=api.chromium_android.devices[0:1]).json.output |
132 | |
133 try: | 156 try: |
| 157 if test_runner: |
| 158 test_runner() |
134 api.chromium_android.run_sharded_perf_tests( | 159 api.chromium_android.run_sharded_perf_tests( |
135 config=api.json.input(data=perf_tests), | 160 config=api.json.input(data=perf_tests), |
136 perf_id=builder['perf_id'], | 161 perf_id=builder['perf_id'], |
137 chartjson_file=True) | 162 chartjson_file=True) |
138 | |
139 finally: | 163 finally: |
140 api.chromium_android.common_tests_final_steps() | 164 api.chromium_android.common_tests_final_steps() |
141 | 165 |
142 def _sanitize_nonalpha(text): | 166 def _sanitize_nonalpha(text): |
143 return ''.join(c if c.isalnum() else '_' for c in text) | 167 return ''.join(c if c.isalnum() else '_' for c in text) |
144 | 168 |
145 def GenTests(api): | 169 def GenTests(api): |
146 for mastername, builders in BUILDERS.iteritems(): | 170 for mastername, builders in BUILDERS.iteritems(): |
147 for buildername in builders: | 171 for buildername in builders: |
148 yield ( | 172 yield ( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 buildername='Android Nexus5 Perf', | 204 buildername='Android Nexus5 Perf', |
181 parent_buildername='parent_buildername', | 205 parent_buildername='parent_buildername', |
182 parent_buildnumber='1729', | 206 parent_buildnumber='1729', |
183 parent_revision='deadbeef', | 207 parent_revision='deadbeef', |
184 revision='deadbeef', | 208 revision='deadbeef', |
185 slavename='slavename', | 209 slavename='slavename', |
186 target='Release') + | 210 target='Release') + |
187 api.override_step_data( | 211 api.override_step_data( |
188 'get perf test list', | 212 'get perf test list', |
189 api.json.output(['perf_test.foo', 'page_cycler.foo']))) | 213 api.json.output(['perf_test.foo', 'page_cycler.foo']))) |
OLD | NEW |