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 | |
87 def RunSteps(api, mastername, buildername): | 86 def RunSteps(api, mastername, buildername): |
88 master_dict = BUILDERS.get(mastername, {}) | 87 master_dict = BUILDERS.get(mastername, {}) |
89 bot_config = master_dict.get('builders', {}).get(buildername) | 88 bot_config = master_dict.get('builders', {}).get(buildername) |
90 # The following lines configures android bisect bot to to checkout codes, | 89 # The following lines configures android bisect bot to to checkout codes, |
91 # executes runhooks, provisions devices and runs legacy bisect script. | 90 # executes runhooks, provisions devices and runs legacy bisect script. |
92 recipe_config = bot_config.get('recipe_config', 'perf') | 91 recipe_config = bot_config.get('recipe_config', 'perf') |
93 kwargs = { | 92 kwargs = { |
94 'REPO_NAME': 'src', | 93 'REPO_NAME': 'src', |
95 'REPO_URL': REPO_URL, | 94 'REPO_URL': REPO_URL, |
96 'INTERNAL': False, | 95 'INTERNAL': False, |
(...skipping 14 matching lines...) Expand all Loading... |
111 master_dict) | 110 master_dict) |
112 | 111 |
113 api.auto_bisect.start_try_job(api, update_step=update_step, bot_db=bot_db) | 112 api.auto_bisect.start_try_job(api, update_step=update_step, bot_db=bot_db) |
114 | 113 |
115 | 114 |
116 def GenTests(api): | 115 def GenTests(api): |
117 config_json_main = { | 116 config_json_main = { |
118 'command': ('./tools/perf/run_benchmark -v --browser=android-chrome ' | 117 'command': ('./tools/perf/run_benchmark -v --browser=android-chrome ' |
119 'sunspider'), | 118 'sunspider'), |
120 'max_time_minutes': '25', | 119 '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 |
145 | 175 |
146 for _, master_dict in BUILDERS.items(): | 176 for _, master_dict in BUILDERS.items(): |
147 for buildername in master_dict.get('builders', {}): | 177 for buildername in master_dict.get('builders', {}): |
148 config_json = config_json_main.copy() | 178 config_json = config_json_main.copy() |
149 yield (api.test('basic_' + buildername) + api.properties.tryserver( | 179 yield (api.test('basic_' + buildername) + api.properties.tryserver( |
150 mastername='tryserver.chromium.perf', | 180 mastername='tryserver.chromium.perf', |
151 buildername=buildername) + api.override_step_data( | 181 buildername=buildername, |
| 182 patch_storage='rietveld', |
| 183 patchset='20001', |
| 184 issue='12345', |
| 185 is_test=True, |
| 186 rietveld="https://codereview.chromium.org") + api.override_step_data( |
152 'git diff to analyze patch', | 187 'git diff to analyze patch', |
153 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) | 188 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) |
154 | 189 |
155 yield ( | 190 yield ( |
156 api.test('basic_perf_tryjob_' + buildername) + | 191 api.test('basic_perf_tryjob_' + buildername) + |
157 api.properties.tryserver( | 192 api.properties.tryserver( |
158 mastername='tryserver.chromium.perf', | 193 mastername='tryserver.chromium.perf', |
159 buildername=buildername) + api.override_step_data( | 194 buildername=buildername, |
| 195 patch_storage='rietveld', |
| 196 patchset='20001', |
| 197 issue='12345', |
| 198 is_test=True, |
| 199 rietveld="https://codereview.chromium.org") + api.override_step_data( |
160 'git diff to analyze patch', | 200 'git diff to analyze patch', |
161 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 201 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
162 api.override_step_data('load config', api.json.output(config_json)) + | 202 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)) + |
163 api.step_data('Performance Test (Without Patch) 1 of 1', | 212 api.step_data('Performance Test (Without Patch) 1 of 1', |
164 stdout=api.raw_io.output(str(results_without_patch))) + | 213 stdout=api.raw_io.output(str(results_without_patch))) + |
165 api.step_data('Performance Test (With Patch) 1 of 1', | 214 api.step_data('Performance Test (With Patch) 1 of 1', |
166 stdout=api.raw_io.output(str(results_with_patch)))) | 215 stdout=api.raw_io.output(str(results_with_patch)))) |
167 config_json.update({'metric': 'dummy/dummy'}) | 216 config_json.update({'metric': 'dummy/dummy'}) |
168 | 217 |
169 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + | 218 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + |
170 api.properties.tryserver( | 219 api.properties.tryserver( |
171 mastername='tryserver.chromium.perf', | 220 mastername='tryserver.chromium.perf', |
172 buildername=buildername) + api.override_step_data( | 221 buildername=buildername, |
173 'git diff to analyze patch', | 222 patch_storage='rietveld', |
174 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 223 patchset='20001', |
175 api.override_step_data('load config', api.json.output(config_json)) | 224 issue='12345', |
176 + api.step_data('Performance Test (Without Patch) 1 of 1', | 225 is_test=True, |
177 stdout=api.raw_io.output(results_without_patch)) + | 226 rietveld="https://codereview.chromium.org") + api.override_step_data( |
178 api.step_data('Performance Test (With Patch) 1 of 1', | 227 'git diff to analyze patch', |
179 stdout=api.raw_io.output(results_with_patch))) | 228 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
| 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))) |
180 | 244 |
181 yield (api.test('perf_tryjob_failed_test_' + buildername) + | 245 yield (api.test('perf_tryjob_failed_test_' + buildername) + |
182 api.properties.tryserver( | 246 api.properties.tryserver( |
183 mastername='tryserver.chromium.perf', | 247 mastername='tryserver.chromium.perf', |
184 buildername=buildername) + api.override_step_data( | 248 buildername=buildername, |
185 'git diff to analyze patch', | 249 patch_storage='rietveld', |
186 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 250 patchset='20001', |
187 api.override_step_data('load config', api.json.output(config_json)) | 251 issue='12345', |
188 + api.step_data('Performance Test (With Patch) 1 of 1', | 252 is_test=True, |
189 retcode=1)) | 253 rietveld="https://codereview.chromium.org") + |
| 254 api.override_step_data( |
| 255 'git diff to analyze patch', |
| 256 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
190 | 257 |
| 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)) |
191 config_json.update({'good_revision': '306475', | 265 config_json.update({'good_revision': '306475', |
192 'bad_revision': '306476'}) | 266 'bad_revision': '306476'}) |
193 | 267 |
194 yield ( | 268 yield ( |
195 api.test('basic_perf_tryjob_with_revisions_' + buildername) + | 269 api.test('basic_perf_tryjob_with_revisions_' + buildername) + |
196 api.properties.tryserver( | 270 api.properties.tryserver( |
197 mastername='tryserver.chromium.perf', | 271 mastername='tryserver.chromium.perf', |
198 buildername=buildername) + api.override_step_data( | 272 buildername=buildername, |
199 'git diff to analyze patch', | 273 patch_storage='rietveld', |
200 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 274 patchset='20001', |
| 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')) + |
201 api.override_step_data('load config', api.json.output(config_json)) + | 281 api.override_step_data('load config', api.json.output(config_json)) + |
202 api.step_data('resolving commit_pos ' + config_json['good_revision'], | 282 api.step_data('resolving commit_pos ' + config_json['good_revision'], |
203 stdout=api.raw_io.output( | 283 stdout=api.raw_io.output( |
204 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + | 284 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + |
205 api.step_data('resolving commit_pos ' + config_json['bad_revision'], | 285 api.step_data('resolving commit_pos ' + config_json['bad_revision'], |
206 stdout=api.raw_io.output( | 286 stdout=api.raw_io.output( |
207 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + | 287 '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)) + |
208 api.step_data( | 293 api.step_data( |
209 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 294 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
210 stdout=api.raw_io.output(results_without_patch)) + | 295 stdout=api.raw_io.output(results_without_patch)) + |
211 api.step_data( | 296 api.step_data( |
212 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 297 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', |
213 stdout=api.raw_io.output(results_with_patch))) | 298 stdout=api.raw_io.output(results_with_patch))) |
214 | 299 |
215 config_json = { | 300 config_json = { |
216 'max_time_minutes': '25', | 301 'max_time_minutes': '25', |
217 'repeat_count': '1', | 302 'repeat_count': '1', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 buildername=buildername) + api.step_data( | 358 buildername=buildername) + api.step_data( |
274 'saving url to temp file', | 359 'saving url to temp file', |
275 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( | 360 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( |
276 'saving json to temp file', | 361 'saving json to temp file', |
277 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( | 362 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( |
278 bisect_config=bisect_config) + api.properties( | 363 bisect_config=bisect_config) + api.properties( |
279 job_name='f7a7b4135624439cbd27fdd5133d74ec') + | 364 job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
280 api.bisect_tester(tempfile='/tmp/dummy') + | 365 api.bisect_tester(tempfile='/tmp/dummy') + |
281 api.properties(parent_got_revision='1111111') + api.properties( | 366 api.properties(parent_got_revision='1111111') + api.properties( |
282 parent_build_archive_url='gs://test-domain/test-archive.zip')) | 367 parent_build_archive_url='gs://test-domain/test-archive.zip')) |
OLD | NEW |