OLD | NEW |
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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.types import freeze | 5 from recipe_engine.types import freeze |
6 | 6 |
7 DEPS = [ | 7 DEPS = [ |
8 'auto_bisect', | 8 'auto_bisect', |
9 'bisect_tester', | 9 'bisect_tester', |
10 'depot_tools/bot_update', | 10 'depot_tools/bot_update', |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 'webview': True, | 76 'webview': True, |
77 }, | 77 }, |
78 }, | 78 }, |
79 }, | 79 }, |
80 }) | 80 }) |
81 | 81 |
82 from recipe_engine.recipe_api import Property | 82 from recipe_engine.recipe_api import Property |
83 | 83 |
84 PROPERTIES = {'mastername': Property(), 'buildername': Property(),} | 84 PROPERTIES = {'mastername': Property(), 'buildername': Property(),} |
85 | 85 |
| 86 |
86 def RunSteps(api, mastername, buildername): | 87 def RunSteps(api, mastername, buildername): |
87 master_dict = BUILDERS.get(mastername, {}) | 88 master_dict = BUILDERS.get(mastername, {}) |
88 bot_config = master_dict.get('builders', {}).get(buildername) | 89 bot_config = master_dict.get('builders', {}).get(buildername) |
89 # The following lines configures android bisect bot to to checkout codes, | 90 # The following lines configures android bisect bot to to checkout codes, |
90 # executes runhooks, provisions devices and runs legacy bisect script. | 91 # executes runhooks, provisions devices and runs legacy bisect script. |
91 recipe_config = bot_config.get('recipe_config', 'perf') | 92 recipe_config = bot_config.get('recipe_config', 'perf') |
92 kwargs = { | 93 kwargs = { |
93 'REPO_NAME': 'src', | 94 'REPO_NAME': 'src', |
94 'REPO_URL': REPO_URL, | 95 'REPO_URL': REPO_URL, |
95 'INTERNAL': False, | 96 'INTERNAL': False, |
(...skipping 14 matching lines...) Expand all Loading... |
110 master_dict) | 111 master_dict) |
111 | 112 |
112 api.auto_bisect.start_try_job(api, update_step=update_step, bot_db=bot_db) | 113 api.auto_bisect.start_try_job(api, update_step=update_step, bot_db=bot_db) |
113 | 114 |
114 | 115 |
115 def GenTests(api): | 116 def GenTests(api): |
116 config_json_main = { | 117 config_json_main = { |
117 'command': ('./tools/perf/run_benchmark -v --browser=android-chrome ' | 118 'command': ('./tools/perf/run_benchmark -v --browser=android-chrome ' |
118 'sunspider'), | 119 'sunspider'), |
119 'max_time_minutes': '25', | 120 'max_time_minutes': '25', |
120 'client_operation_id': '12345726327327', | |
121 'repeat_count': '1', | 121 'repeat_count': '1', |
122 'truncate_percent': '25', | 122 'truncate_percent': '25', |
123 'target_arch': 'ia32', | 123 'target_arch': 'ia32', |
124 } | 124 } |
125 | 125 |
126 results_with_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms | 126 results_with_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms |
127 Avg dummy: 5.907711ms | 127 Avg dummy: 5.907711ms |
128 Sd dummy: 0.255921ms | 128 Sd dummy: 0.255921ms |
129 RESULT telemetry_page_measurement_results: num_failed= 0 count | 129 RESULT telemetry_page_measurement_results: num_failed= 0 count |
130 RESULT telemetry_page_measurement_results: num_errored= 0 count | 130 RESULT telemetry_page_measurement_results: num_errored= 0 count |
131 | 131 |
132 View online at http://storage.googleapis.com/chromium-telemetry/\ | 132 View online at http://storage.googleapis.com/chromium-telemetry/\ |
133 html-results/results-with_patch | 133 html-results/results-with_patch |
134 """ | 134 """ |
135 | 135 |
136 results_without_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms | 136 results_without_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms |
137 Avg dummy: 5.907711ms | 137 Avg dummy: 5.907711ms |
138 Sd dummy: 0.255921ms | 138 Sd dummy: 0.255921ms |
139 RESULT telemetry_page_measurement_results: num_failed= 0 count | 139 RESULT telemetry_page_measurement_results: num_failed= 0 count |
140 RESULT telemetry_page_measurement_results: num_errored= 0 count | 140 RESULT telemetry_page_measurement_results: num_errored= 0 count |
141 | 141 |
142 View online at http://storage.googleapis.com/chromium-telemetry/html-results/\ | 142 View online at http://storage.googleapis.com/chromium-telemetry/html-results/\ |
143 results-without_patch | 143 results-without_patch |
144 """ | 144 """ |
145 buildbucket_put_response = { | |
146 "results":[{ | |
147 "build":{ | |
148 "status": "SCHEDULED", | |
149 "created_ts": "1459200369835900", | |
150 "bucket": "user.username", | |
151 "result_details_json": "null", | |
152 "status_changed_ts": "1459200369835930", | |
153 "created_by": "user:username@example.com", | |
154 "updated_ts": "1459200369835940", | |
155 "utcnow_ts": "1459200369962370", | |
156 "parameters_json": "{\"This_has_been\": \"removed\"}", | |
157 "id": "9016911228971028736" | |
158 }, | |
159 "kind": "buildbucket#resourcesItem", | |
160 "etag": "\"8uCIh8TRuYs4vPN3iWmly9SJMqw\"" | |
161 }] | |
162 } | |
163 | |
164 buildbucket_get_response = { | |
165 "build":{ | |
166 "bucket": "master.tryserver.chromium.perf", | |
167 "id": "9009962699124567824", | |
168 "result": "SUCCESS", | |
169 "status": "COMPLETED", | |
170 "status_changed_utc": "Mon Jun 13 19:32:37 2016", | |
171 "updated_utc": "Mon Jun 13 19:32:37 2016", | |
172 "url": "http://build.chromium.org/p/tryserver.chromium.perf/builders/linux
_perf_bisect/builds/6537", | |
173 "utcnow_utc": "Tue Jun 21 21:33:56 2016" | |
174 } | |
175 } | |
176 | |
177 | 145 |
178 for _, master_dict in BUILDERS.items(): | 146 for _, master_dict in BUILDERS.items(): |
179 for buildername in master_dict.get('builders', {}): | 147 for buildername in master_dict.get('builders', {}): |
180 config_json = config_json_main.copy() | 148 config_json = config_json_main.copy() |
181 yield (api.test('basic_' + buildername) + api.properties.tryserver( | 149 yield (api.test('basic_' + buildername) + api.properties.tryserver( |
182 mastername='tryserver.chromium.perf', | 150 mastername='tryserver.chromium.perf', |
183 buildername=buildername, | 151 buildername=buildername) + api.override_step_data( |
184 patch_storage='rietveld', | |
185 patchset='20001', | |
186 issue='12345', | |
187 is_test=True, | |
188 rietveld="https://codereview.chromium.org") + api.override_step_data( | |
189 'git diff to analyze patch', | 152 'git diff to analyze patch', |
190 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) | 153 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) |
191 | 154 |
192 yield ( | 155 yield ( |
193 api.test('basic_perf_tryjob_' + buildername) + | 156 api.test('basic_perf_tryjob_' + buildername) + |
194 api.properties.tryserver( | 157 api.properties.tryserver( |
195 mastername='tryserver.chromium.perf', | 158 mastername='tryserver.chromium.perf', |
196 buildername=buildername, | 159 buildername=buildername) + api.override_step_data( |
197 patch_storage='rietveld', | |
198 patchset='20001', | |
199 issue='12345', | |
200 is_test=True, | |
201 rietveld="https://codereview.chromium.org") + api.override_step_data( | |
202 'git diff to analyze patch', | 160 'git diff to analyze patch', |
203 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 161 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
204 api.override_step_data('load config', api.json.output(config_json)) + | 162 api.override_step_data('load config', api.json.output(config_json)) + |
205 api.step_data('gsutil exists', retcode=1) + | |
206 api.step_data('buildbucket.put', | |
207 stdout=api.json.output(buildbucket_put_response)) + | |
208 api.step_data('buildbucket.put (2)', | |
209 stdout=api.json.output(buildbucket_put_response)) + | |
210 api.step_data('buildbucket.get', | |
211 stdout=api.json.output(buildbucket_get_response)) + | |
212 api.step_data('buildbucket.get (2)', | |
213 stdout=api.json.output(buildbucket_get_response)) + | |
214 api.step_data('Performance Test (Without Patch) 1 of 1', | 163 api.step_data('Performance Test (Without Patch) 1 of 1', |
215 stdout=api.raw_io.output(str(results_without_patch))) + | 164 stdout=api.raw_io.output(str(results_without_patch))) + |
216 api.step_data('Performance Test (With Patch) 1 of 1', | 165 api.step_data('Performance Test (With Patch) 1 of 1', |
217 stdout=api.raw_io.output(str(results_with_patch)))) | 166 stdout=api.raw_io.output(str(results_with_patch)))) |
218 config_json.update({'metric': 'dummy/dummy'}) | 167 config_json.update({'metric': 'dummy/dummy'}) |
219 | 168 |
220 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + | 169 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + |
221 api.properties.tryserver( | 170 api.properties.tryserver( |
222 mastername='tryserver.chromium.perf', | 171 mastername='tryserver.chromium.perf', |
223 buildername=buildername, | 172 buildername=buildername) + api.override_step_data( |
224 patch_storage='rietveld', | 173 'git diff to analyze patch', |
225 patchset='20001', | 174 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
226 issue='12345', | 175 api.override_step_data('load config', api.json.output(config_json)) |
227 is_test=True, | 176 + api.step_data('Performance Test (Without Patch) 1 of 1', |
228 rietveld="https://codereview.chromium.org") + api.override_step_data( | 177 stdout=api.raw_io.output(results_without_patch)) + |
229 'git diff to analyze patch', | 178 api.step_data('Performance Test (With Patch) 1 of 1', |
230 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 179 stdout=api.raw_io.output(results_with_patch))) |
231 api.override_step_data('load config', | |
232 api.json.output(config_json)) + | |
233 api.step_data('gsutil exists', retcode=1) + | |
234 api.step_data('buildbucket.put', | |
235 stdout=api.json.output(buildbucket_put_response)) + | |
236 api.step_data('buildbucket.put (2)', | |
237 stdout=api.json.output(buildbucket_put_response)) + | |
238 api.step_data('buildbucket.get', | |
239 stdout=api.json.output(buildbucket_get_response)) + | |
240 api.step_data('buildbucket.get (2)', | |
241 stdout=api.json.output(buildbucket_get_response)) + | |
242 api.step_data('Performance Test (Without Patch) 1 of 1', | |
243 stdout=api.raw_io.output(results_without_patch)) + | |
244 api.step_data('Performance Test (With Patch) 1 of 1', | |
245 stdout=api.raw_io.output(results_with_patch))) | |
246 | 180 |
247 yield (api.test('perf_tryjob_failed_test_' + buildername) + | 181 yield (api.test('perf_tryjob_failed_test_' + buildername) + |
248 api.properties.tryserver( | 182 api.properties.tryserver( |
249 mastername='tryserver.chromium.perf', | 183 mastername='tryserver.chromium.perf', |
250 buildername=buildername, | 184 buildername=buildername) + api.override_step_data( |
251 patch_storage='rietveld', | 185 'git diff to analyze patch', |
252 patchset='20001', | 186 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
253 issue='12345', | 187 api.override_step_data('load config', api.json.output(config_json)) |
254 is_test=True, | 188 + api.step_data('Performance Test (With Patch) 1 of 1', |
255 rietveld="https://codereview.chromium.org") + | 189 retcode=1)) |
256 api.override_step_data( | |
257 'git diff to analyze patch', | |
258 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | |
259 | 190 |
260 api.override_step_data('load config', api.json.output(config_json)) + | |
261 api.step_data('gsutil exists', retcode=1) + | |
262 api.step_data('buildbucket.put', | |
263 stdout=api.json.output(buildbucket_put_response)) + | |
264 api.step_data('buildbucket.get', | |
265 stdout=api.json.output(buildbucket_get_response)) + | |
266 api.step_data('Performance Test (With Patch) 1 of 1', retcode=1)) | |
267 config_json.update({'good_revision': '306475', | 191 config_json.update({'good_revision': '306475', |
268 'bad_revision': '306476'}) | 192 'bad_revision': '306476'}) |
269 | 193 |
270 yield ( | 194 yield ( |
271 api.test('basic_perf_tryjob_with_revisions_' + buildername) + | 195 api.test('basic_perf_tryjob_with_revisions_' + buildername) + |
272 api.properties.tryserver( | 196 api.properties.tryserver( |
273 mastername='tryserver.chromium.perf', | 197 mastername='tryserver.chromium.perf', |
274 buildername=buildername, | 198 buildername=buildername) + api.override_step_data( |
275 patch_storage='rietveld', | 199 'git diff to analyze patch', |
276 patchset='20001', | 200 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
277 issue='12345', | |
278 is_test=True, | |
279 rietveld="https://codereview.chromium.org") + | |
280 api.override_step_data( | |
281 'git diff to analyze patch', | |
282 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | |
283 api.override_step_data('load config', api.json.output(config_json)) + | 201 api.override_step_data('load config', api.json.output(config_json)) + |
284 api.step_data('resolving commit_pos ' + config_json['good_revision'], | 202 api.step_data('resolving commit_pos ' + config_json['good_revision'], |
285 stdout=api.raw_io.output( | 203 stdout=api.raw_io.output( |
286 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + | 204 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + |
287 api.step_data('resolving commit_pos ' + config_json['bad_revision'], | 205 api.step_data('resolving commit_pos ' + config_json['bad_revision'], |
288 stdout=api.raw_io.output( | 206 stdout=api.raw_io.output( |
289 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + | 207 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + |
290 api.step_data('gsutil exists', retcode=1) + | |
291 api.step_data('buildbucket.put', | |
292 stdout=api.json.output(buildbucket_put_response)) + | |
293 api.step_data('buildbucket.get', | |
294 stdout=api.json.output(buildbucket_get_response)) + | |
295 api.step_data( | 208 api.step_data( |
296 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 209 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
297 stdout=api.raw_io.output(results_without_patch)) + | 210 stdout=api.raw_io.output(results_without_patch)) + |
298 api.step_data( | 211 api.step_data( |
299 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 212 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
300 stdout=api.raw_io.output(results_with_patch))) | 213 stdout=api.raw_io.output(results_with_patch))) |
301 | 214 |
302 config_json = { | 215 config_json = { |
303 'max_time_minutes': '25', | 216 'max_time_minutes': '25', |
304 'repeat_count': '1', | 217 'repeat_count': '1', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 buildername=buildername) + api.step_data( | 273 buildername=buildername) + api.step_data( |
361 'saving url to temp file', | 274 'saving url to temp file', |
362 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( | 275 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( |
363 'saving json to temp file', | 276 'saving json to temp file', |
364 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( | 277 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( |
365 bisect_config=bisect_config) + api.properties( | 278 bisect_config=bisect_config) + api.properties( |
366 job_name='f7a7b4135624439cbd27fdd5133d74ec') + | 279 job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
367 api.bisect_tester(tempfile='/tmp/dummy') + | 280 api.bisect_tester(tempfile='/tmp/dummy') + |
368 api.properties(parent_got_revision='1111111') + api.properties( | 281 api.properties(parent_got_revision='1111111') + api.properties( |
369 parent_build_archive_url='gs://test-domain/test-archive.zip')) | 282 parent_build_archive_url='gs://test-domain/test-archive.zip')) |
OLD | NEW |