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 "bucket": "master.tryserver.chromium.perf", | |
166 "id": "9009962699124567824", | |
167 "result": "SUCCESS", | |
168 "status": "COMPLETED", | |
169 "status_changed_utc": "Mon Jun 13 19:32:37 2016", | |
170 "updated_utc": "Mon Jun 13 19:32:37 2016", | |
171 "url": "http://build.chromium.org/p/tryserver.chromium.perf/builders/linux_p
erf_bisect/builds/6537", | |
172 "utcnow_utc": "Tue Jun 21 21:33:56 2016" | |
173 } | |
174 | |
175 | 145 |
176 for _, master_dict in BUILDERS.items(): | 146 for _, master_dict in BUILDERS.items(): |
177 for buildername in master_dict.get('builders', {}): | 147 for buildername in master_dict.get('builders', {}): |
178 config_json = config_json_main.copy() | 148 config_json = config_json_main.copy() |
179 yield (api.test('basic_' + buildername) + api.properties.tryserver( | 149 yield (api.test('basic_' + buildername) + api.properties.tryserver( |
180 mastername='tryserver.chromium.perf', | 150 mastername='tryserver.chromium.perf', |
181 buildername=buildername, | 151 buildername=buildername) + api.override_step_data( |
182 patch_storage='rietveld', | |
183 patchset='20001', | |
184 issue='12345', | |
185 is_test=True, | |
186 rietveld="https://codereview.chromium.org") + api.override_step_data( | |
187 'git diff to analyze patch', | 152 'git diff to analyze patch', |
188 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) | 153 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) |
189 | 154 |
190 yield ( | 155 yield ( |
191 api.test('basic_perf_tryjob_' + buildername) + | 156 api.test('basic_perf_tryjob_' + buildername) + |
192 api.properties.tryserver( | 157 api.properties.tryserver( |
193 mastername='tryserver.chromium.perf', | 158 mastername='tryserver.chromium.perf', |
194 buildername=buildername, | 159 buildername=buildername) + api.override_step_data( |
195 patch_storage='rietveld', | |
196 patchset='20001', | |
197 issue='12345', | |
198 is_test=True, | |
199 rietveld="https://codereview.chromium.org") + api.override_step_data( | |
200 'git diff to analyze patch', | 160 'git diff to analyze patch', |
201 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 161 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
202 api.override_step_data('load config', api.json.output(config_json)) + | 162 api.override_step_data('load config', api.json.output(config_json)) + |
203 api.step_data('gsutil exists', retcode=1) + | |
204 api.step_data('buildbucket.put', | |
205 stdout=api.json.output(buildbucket_put_response)) + | |
206 api.step_data('buildbucket.put (2)', | |
207 stdout=api.json.output(buildbucket_put_response)) + | |
208 api.step_data('buildbucket.get', | |
209 stdout=api.json.output(buildbucket_get_response)) + | |
210 api.step_data('buildbucket.get (2)', | |
211 stdout=api.json.output(buildbucket_get_response)) + | |
212 api.step_data('Performance Test (Without Patch) 1 of 1', | 163 api.step_data('Performance Test (Without Patch) 1 of 1', |
213 stdout=api.raw_io.output(str(results_without_patch))) + | 164 stdout=api.raw_io.output(str(results_without_patch))) + |
214 api.step_data('Performance Test (With Patch) 1 of 1', | 165 api.step_data('Performance Test (With Patch) 1 of 1', |
215 stdout=api.raw_io.output(str(results_with_patch)))) | 166 stdout=api.raw_io.output(str(results_with_patch)))) |
216 config_json.update({'metric': 'dummy/dummy'}) | 167 config_json.update({'metric': 'dummy/dummy'}) |
217 | 168 |
218 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + | 169 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + |
219 api.properties.tryserver( | 170 api.properties.tryserver( |
220 mastername='tryserver.chromium.perf', | 171 mastername='tryserver.chromium.perf', |
221 buildername=buildername, | 172 buildername=buildername) + api.override_step_data( |
222 patch_storage='rietveld', | 173 'git diff to analyze patch', |
223 patchset='20001', | 174 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
224 issue='12345', | 175 api.override_step_data('load config', api.json.output(config_json)) |
225 is_test=True, | 176 + api.step_data('Performance Test (Without Patch) 1 of 1', |
226 rietveld="https://codereview.chromium.org") + api.override_step_data( | 177 stdout=api.raw_io.output(results_without_patch)) + |
227 'git diff to analyze patch', | 178 api.step_data('Performance Test (With Patch) 1 of 1', |
228 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 179 stdout=api.raw_io.output(results_with_patch))) |
229 api.override_step_data('load config', | |
230 api.json.output(config_json)) + | |
231 api.step_data('gsutil exists', retcode=1) + | |
232 api.step_data('buildbucket.put', | |
233 stdout=api.json.output(buildbucket_put_response)) + | |
234 api.step_data('buildbucket.put (2)', | |
235 stdout=api.json.output(buildbucket_put_response)) + | |
236 api.step_data('buildbucket.get', | |
237 stdout=api.json.output(buildbucket_get_response)) + | |
238 api.step_data('buildbucket.get (2)', | |
239 stdout=api.json.output(buildbucket_get_response)) + | |
240 api.step_data('Performance Test (Without Patch) 1 of 1', | |
241 stdout=api.raw_io.output(results_without_patch)) + | |
242 api.step_data('Performance Test (With Patch) 1 of 1', | |
243 stdout=api.raw_io.output(results_with_patch))) | |
244 | 180 |
245 yield (api.test('perf_tryjob_failed_test_' + buildername) + | 181 yield (api.test('perf_tryjob_failed_test_' + buildername) + |
246 api.properties.tryserver( | 182 api.properties.tryserver( |
247 mastername='tryserver.chromium.perf', | 183 mastername='tryserver.chromium.perf', |
248 buildername=buildername, | 184 buildername=buildername) + api.override_step_data( |
249 patch_storage='rietveld', | 185 'git diff to analyze patch', |
250 patchset='20001', | 186 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
251 issue='12345', | 187 api.override_step_data('load config', api.json.output(config_json)) |
252 is_test=True, | 188 + api.step_data('Performance Test (With Patch) 1 of 1', |
253 rietveld="https://codereview.chromium.org") + | 189 retcode=1)) |
254 api.override_step_data( | |
255 'git diff to analyze patch', | |
256 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | |
257 | 190 |
258 api.override_step_data('load config', api.json.output(config_json)) + | |
259 api.step_data('gsutil exists', retcode=1) + | |
260 api.step_data('buildbucket.put', | |
261 stdout=api.json.output(buildbucket_put_response)) + | |
262 api.step_data('buildbucket.get', | |
263 stdout=api.json.output(buildbucket_get_response)) + | |
264 api.step_data('Performance Test (With Patch) 1 of 1', retcode=1)) | |
265 config_json.update({'good_revision': '306475', | 191 config_json.update({'good_revision': '306475', |
266 'bad_revision': '306476'}) | 192 'bad_revision': '306476'}) |
267 | 193 |
268 yield ( | 194 yield ( |
269 api.test('basic_perf_tryjob_with_revisions_' + buildername) + | 195 api.test('basic_perf_tryjob_with_revisions_' + buildername) + |
270 api.properties.tryserver( | 196 api.properties.tryserver( |
271 mastername='tryserver.chromium.perf', | 197 mastername='tryserver.chromium.perf', |
272 buildername=buildername, | 198 buildername=buildername) + api.override_step_data( |
273 patch_storage='rietveld', | 199 'git diff to analyze patch', |
274 patchset='20001', | 200 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
275 issue='12345', | |
276 is_test=True, | |
277 rietveld="https://codereview.chromium.org") + | |
278 api.override_step_data( | |
279 'git diff to analyze patch', | |
280 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | |
281 api.override_step_data('load config', api.json.output(config_json)) + | 201 api.override_step_data('load config', api.json.output(config_json)) + |
282 api.step_data('resolving commit_pos ' + config_json['good_revision'], | 202 api.step_data('resolving commit_pos ' + config_json['good_revision'], |
283 stdout=api.raw_io.output( | 203 stdout=api.raw_io.output( |
284 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + | 204 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + |
285 api.step_data('resolving commit_pos ' + config_json['bad_revision'], | 205 api.step_data('resolving commit_pos ' + config_json['bad_revision'], |
286 stdout=api.raw_io.output( | 206 stdout=api.raw_io.output( |
287 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + | 207 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + |
288 api.step_data('gsutil exists', retcode=1) + | |
289 api.step_data('buildbucket.put', | |
290 stdout=api.json.output(buildbucket_put_response)) + | |
291 api.step_data('buildbucket.get', | |
292 stdout=api.json.output(buildbucket_get_response)) + | |
293 api.step_data( | 208 api.step_data( |
294 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 209 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
295 stdout=api.raw_io.output(results_without_patch)) + | 210 stdout=api.raw_io.output(results_without_patch)) + |
296 api.step_data( | 211 api.step_data( |
297 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 212 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
298 stdout=api.raw_io.output(results_with_patch))) | 213 stdout=api.raw_io.output(results_with_patch))) |
299 | 214 |
300 config_json = { | 215 config_json = { |
301 'max_time_minutes': '25', | 216 'max_time_minutes': '25', |
302 'repeat_count': '1', | 217 'repeat_count': '1', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 buildername=buildername) + api.step_data( | 273 buildername=buildername) + api.step_data( |
359 'saving url to temp file', | 274 'saving url to temp file', |
360 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( | 275 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( |
361 'saving json to temp file', | 276 'saving json to temp file', |
362 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( | 277 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( |
363 bisect_config=bisect_config) + api.properties( | 278 bisect_config=bisect_config) + api.properties( |
364 job_name='f7a7b4135624439cbd27fdd5133d74ec') + | 279 job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
365 api.bisect_tester(tempfile='/tmp/dummy') + | 280 api.bisect_tester(tempfile='/tmp/dummy') + |
366 api.properties(parent_got_revision='1111111') + api.properties( | 281 api.properties(parent_got_revision='1111111') + api.properties( |
367 parent_build_archive_url='gs://test-domain/test-archive.zip')) | 282 parent_build_archive_url='gs://test-domain/test-archive.zip')) |
OLD | NEW |