Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 | 134 |
| 136 results_without_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms | 135 results_without_patch = """*RESULT dummy: dummy= [5.83,6.013,5.573]ms |
| 137 Avg dummy: 5.907711ms | 136 Avg dummy: 5.907711ms |
| 138 Sd dummy: 0.255921ms | 137 Sd dummy: 0.255921ms |
| 139 RESULT telemetry_page_measurement_results: num_failed= 0 count | 138 RESULT telemetry_page_measurement_results: num_failed= 0 count |
| 140 RESULT telemetry_page_measurement_results: num_errored= 0 count | 139 RESULT telemetry_page_measurement_results: num_errored= 0 count |
| 141 | 140 |
| 142 View online at http://storage.googleapis.com/chromium-telemetry/html-results/\ | 141 View online at http://storage.googleapis.com/chromium-telemetry/html-results/\ |
| 143 results-without_patch | 142 results-without_patch |
| 144 """ | 143 """ |
| 144 buildbucket_put_response = { | |
| 145 "results":[{ | |
| 146 "build":{ | |
| 147 "status": "SCHEDULED", | |
| 148 "created_ts": "1459200369835900", | |
| 149 "bucket": "user.username", | |
| 150 "result_details_json": "null", | |
| 151 "status_changed_ts": "1459200369835930", | |
| 152 "created_by": "user:username@example.com", | |
| 153 "updated_ts": "1459200369835940", | |
| 154 "utcnow_ts": "1459200369962370", | |
| 155 "parameters_json": "{\"This_has_been\": \"removed\"}", | |
| 156 "id": "9016911228971028736" | |
| 157 }, | |
| 158 "kind": "buildbucket#resourcesItem", | |
| 159 "etag": "\"8uCIh8TRuYs4vPN3iWmly9SJMqw\"" | |
| 160 }] | |
| 161 } | |
| 162 | |
| 163 buildbucket_get_response = { | |
| 164 "bucket": "master.tryserver.chromium.perf", | |
| 165 "id": "9009962699124567824", | |
| 166 "result": "SUCCESS", | |
| 167 "status": "COMPLETED", | |
| 168 "status_changed_utc": "Mon Jun 13 19:32:37 2016", | |
| 169 "updated_utc": "Mon Jun 13 19:32:37 2016", | |
| 170 "url": "http://build.chromium.org/p/tryserver.chromium.perf/builders/linux_p erf_bisect/builds/6537", | |
| 171 "utcnow_utc": "Tue Jun 21 21:33:56 2016" | |
| 172 } | |
| 173 | |
| 145 | 174 |
| 146 for _, master_dict in BUILDERS.items(): | 175 for _, master_dict in BUILDERS.items(): |
| 147 for buildername in master_dict.get('builders', {}): | 176 for buildername in master_dict.get('builders', {}): |
| 148 config_json = config_json_main.copy() | 177 config_json = config_json_main.copy() |
| 149 yield (api.test('basic_' + buildername) + api.properties.tryserver( | 178 yield (api.test('basic_' + buildername) + api.properties.tryserver( |
| 150 mastername='tryserver.chromium.perf', | 179 mastername='tryserver.chromium.perf', |
| 151 buildername=buildername) + api.override_step_data( | 180 buildername=buildername) + api.override_step_data( |
| 152 'git diff to analyze patch', | 181 'git diff to analyze patch', |
| 153 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) | 182 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) |
| 154 | 183 |
| 155 yield ( | 184 yield ( |
| 156 api.test('basic_perf_tryjob_' + buildername) + | 185 api.test('basic_perf_tryjob_' + buildername) + |
| 157 api.properties.tryserver( | 186 api.properties.tryserver( |
| 158 mastername='tryserver.chromium.perf', | 187 mastername='tryserver.chromium.perf', |
| 159 buildername=buildername) + api.override_step_data( | 188 buildername=buildername) + api.override_step_data( |
|
RobertoCN
2016/06/22 19:01:34
patch_storage='rietveld', patchset='20001', issue=
| |
| 160 'git diff to analyze patch', | 189 'git diff to analyze patch', |
| 161 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 190 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
| 162 api.override_step_data('load config', api.json.output(config_json)) + | 191 api.override_step_data('load config', api.json.output(config_json)) + |
| 163 api.step_data('Performance Test (Without Patch) 1 of 1', | 192 api.step_data('buildbucket.put', |
| 164 stdout=api.raw_io.output(str(results_without_patch))) + | 193 stdout=api.json.output(buildbucket_put_response)) + |
| 165 api.step_data('Performance Test (With Patch) 1 of 1', | 194 api.step_data('buildbucket.get', |
| 166 stdout=api.raw_io.output(str(results_with_patch)))) | 195 stdout=api.json.output(buildbucket_get_response))) |
| 167 config_json.update({'metric': 'dummy/dummy'}) | 196 config_json.update({'metric': 'dummy/dummy'}) |
| 168 | 197 |
| 169 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + | 198 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + |
| 170 api.properties.tryserver( | 199 api.properties.tryserver( |
| 171 mastername='tryserver.chromium.perf', | 200 mastername='tryserver.chromium.perf', |
| 172 buildername=buildername) + api.override_step_data( | 201 buildername=buildername) + api.override_step_data( |
| 173 'git diff to analyze patch', | 202 'git diff to analyze patch', |
| 174 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 203 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
| 175 api.override_step_data('load config', api.json.output(config_json)) | 204 api.override_step_data('load config', api.json.output(config_json)) |
| 176 + api.step_data('Performance Test (Without Patch) 1 of 1', | 205 + api.step_data('buildbucket.put', |
| 177 stdout=api.raw_io.output(results_without_patch)) + | 206 stdout=api.json.output(buildbucket_put_response)) |
| 178 api.step_data('Performance Test (With Patch) 1 of 1', | 207 + api.step_data('buildbucket.get', |
| 179 stdout=api.raw_io.output(results_with_patch))) | 208 stdout=api.json.output(buildbucket_get_response))) |
| 180 | 209 |
| 181 yield (api.test('perf_tryjob_failed_test_' + buildername) + | 210 yield (api.test('perf_tryjob_failed_test_' + buildername) + |
| 182 api.properties.tryserver( | 211 api.properties.tryserver( |
| 183 mastername='tryserver.chromium.perf', | 212 mastername='tryserver.chromium.perf', |
| 184 buildername=buildername) + api.override_step_data( | 213 buildername=buildername) + api.override_step_data( |
| 185 'git diff to analyze patch', | 214 'git diff to analyze patch', |
| 186 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 215 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
| 216 | |
| 187 api.override_step_data('load config', api.json.output(config_json)) | 217 api.override_step_data('load config', api.json.output(config_json)) |
| 188 + api.step_data('Performance Test (With Patch) 1 of 1', | 218 + api.step_data('buildbucket.put', |
| 189 retcode=1)) | 219 stdout=api.json.output(buildbucket_put_response)) |
| 190 | 220 + api.step_data('buildbucket.get', |
| 221 stdout=api.json.output(buildbucket_get_response))) | |
| 191 config_json.update({'good_revision': '306475', | 222 config_json.update({'good_revision': '306475', |
| 192 'bad_revision': '306476'}) | 223 'bad_revision': '306476'}) |
| 193 | 224 |
| 194 yield ( | 225 yield ( |
| 195 api.test('basic_perf_tryjob_with_revisions_' + buildername) + | 226 api.test('basic_perf_tryjob_with_revisions_' + buildername) + |
| 196 api.properties.tryserver( | 227 api.properties.tryserver( |
| 197 mastername='tryserver.chromium.perf', | 228 mastername='tryserver.chromium.perf', |
| 198 buildername=buildername) + api.override_step_data( | 229 buildername=buildername) + api.override_step_data( |
| 199 'git diff to analyze patch', | 230 'git diff to analyze patch', |
| 200 api.raw_io.stream_output('tools/run-perf-test.cfg')) + | 231 api.raw_io.stream_output('tools/run-perf-test.cfg')) + |
| 201 api.override_step_data('load config', api.json.output(config_json)) + | 232 api.override_step_data('load config', api.json.output(config_json)) + |
| 202 api.step_data('resolving commit_pos ' + config_json['good_revision'], | 233 api.step_data('resolving commit_pos ' + config_json['good_revision'], |
| 203 stdout=api.raw_io.output( | 234 stdout=api.raw_io.output( |
| 204 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + | 235 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + |
| 205 api.step_data('resolving commit_pos ' + config_json['bad_revision'], | 236 api.step_data('resolving commit_pos ' + config_json['bad_revision'], |
| 206 stdout=api.raw_io.output( | 237 stdout=api.raw_io.output( |
| 207 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + | 238 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + |
| 208 api.step_data( | 239 api.step_data('buildbucket.put', |
| 209 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | 240 stdout=api.json.output(buildbucket_put_response)) + |
| 210 stdout=api.raw_io.output(results_without_patch)) + | 241 api.step_data('buildbucket.get', |
| 211 api.step_data( | 242 stdout=api.json.output(buildbucket_get_response))) |
| 212 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', | |
| 213 stdout=api.raw_io.output(results_with_patch))) | |
| 214 | 243 |
| 215 config_json = { | 244 config_json = { |
| 216 'max_time_minutes': '25', | 245 'max_time_minutes': '25', |
| 217 'repeat_count': '1', | 246 'repeat_count': '1', |
| 218 'truncate_percent': '25', | 247 'truncate_percent': '25', |
| 219 'target_arch': 'ia32', | 248 'target_arch': 'ia32', |
| 220 } | 249 } |
| 221 | 250 |
| 222 yield ( | 251 yield ( |
| 223 api.test('perf_tryjob_config_error_' + buildername) + | 252 api.test('perf_tryjob_config_error_' + buildername) + |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 buildername=buildername) + api.step_data( | 302 buildername=buildername) + api.step_data( |
| 274 'saving url to temp file', | 303 'saving url to temp file', |
| 275 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( | 304 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( |
| 276 'saving json to temp file', | 305 'saving json to temp file', |
| 277 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( | 306 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( |
| 278 bisect_config=bisect_config) + api.properties( | 307 bisect_config=bisect_config) + api.properties( |
| 279 job_name='f7a7b4135624439cbd27fdd5133d74ec') + | 308 job_name='f7a7b4135624439cbd27fdd5133d74ec') + |
| 280 api.bisect_tester(tempfile='/tmp/dummy') + | 309 api.bisect_tester(tempfile='/tmp/dummy') + |
| 281 api.properties(parent_got_revision='1111111') + api.properties( | 310 api.properties(parent_got_revision='1111111') + api.properties( |
| 282 parent_build_archive_url='gs://test-domain/test-archive.zip')) | 311 parent_build_archive_url='gs://test-domain/test-archive.zip')) |
| OLD | NEW |