Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: scripts/slave/recipes/bisection/android_bisect.py

Issue 2113033002: Reland "Build delegation for perf tryjobs" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: update step data and expectation files Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 "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
145 177
146 for _, master_dict in BUILDERS.items(): 178 for _, master_dict in BUILDERS.items():
147 for buildername in master_dict.get('builders', {}): 179 for buildername in master_dict.get('builders', {}):
148 config_json = config_json_main.copy() 180 config_json = config_json_main.copy()
149 yield (api.test('basic_' + buildername) + api.properties.tryserver( 181 yield (api.test('basic_' + buildername) + api.properties.tryserver(
150 mastername='tryserver.chromium.perf', 182 mastername='tryserver.chromium.perf',
151 buildername=buildername) + api.override_step_data( 183 buildername=buildername,
184 patch_storage='rietveld',
185 patchset='20001',
186 issue='12345',
187 is_test=True,
188 rietveld="https://codereview.chromium.org") + api.override_step_data(
152 'git diff to analyze patch', 189 'git diff to analyze patch',
153 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg'))) 190 api.raw_io.stream_output('tools/auto_bisect/bisect.cfg')))
154 191
155 yield ( 192 yield (
156 api.test('basic_perf_tryjob_' + buildername) + 193 api.test('basic_perf_tryjob_' + buildername) +
157 api.properties.tryserver( 194 api.properties.tryserver(
158 mastername='tryserver.chromium.perf', 195 mastername='tryserver.chromium.perf',
159 buildername=buildername) + api.override_step_data( 196 buildername=buildername,
197 patch_storage='rietveld',
198 patchset='20001',
199 issue='12345',
200 is_test=True,
201 rietveld="https://codereview.chromium.org") + api.override_step_data(
160 'git diff to analyze patch', 202 'git diff to analyze patch',
161 api.raw_io.stream_output('tools/run-perf-test.cfg')) + 203 api.raw_io.stream_output('tools/run-perf-test.cfg')) +
162 api.override_step_data('load config', api.json.output(config_json)) + 204 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)) +
163 api.step_data('Performance Test (Without Patch) 1 of 1', 214 api.step_data('Performance Test (Without Patch) 1 of 1',
164 stdout=api.raw_io.output(str(results_without_patch))) + 215 stdout=api.raw_io.output(str(results_without_patch))) +
165 api.step_data('Performance Test (With Patch) 1 of 1', 216 api.step_data('Performance Test (With Patch) 1 of 1',
166 stdout=api.raw_io.output(str(results_with_patch)))) 217 stdout=api.raw_io.output(str(results_with_patch))))
167 config_json.update({'metric': 'dummy/dummy'}) 218 config_json.update({'metric': 'dummy/dummy'})
168 219
169 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) + 220 yield (api.test('basic_perf_tryjob_with_metric_' + buildername) +
170 api.properties.tryserver( 221 api.properties.tryserver(
171 mastername='tryserver.chromium.perf', 222 mastername='tryserver.chromium.perf',
172 buildername=buildername) + api.override_step_data( 223 buildername=buildername,
173 'git diff to analyze patch', 224 patch_storage='rietveld',
174 api.raw_io.stream_output('tools/run-perf-test.cfg')) + 225 patchset='20001',
175 api.override_step_data('load config', api.json.output(config_json)) 226 issue='12345',
176 + api.step_data('Performance Test (Without Patch) 1 of 1', 227 is_test=True,
177 stdout=api.raw_io.output(results_without_patch)) + 228 rietveld="https://codereview.chromium.org") + api.override_step_data(
178 api.step_data('Performance Test (With Patch) 1 of 1', 229 'git diff to analyze patch',
179 stdout=api.raw_io.output(results_with_patch))) 230 api.raw_io.stream_output('tools/run-perf-test.cfg')) +
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)))
180 246
181 yield (api.test('perf_tryjob_failed_test_' + buildername) + 247 yield (api.test('perf_tryjob_failed_test_' + buildername) +
182 api.properties.tryserver( 248 api.properties.tryserver(
183 mastername='tryserver.chromium.perf', 249 mastername='tryserver.chromium.perf',
184 buildername=buildername) + api.override_step_data( 250 buildername=buildername,
185 'git diff to analyze patch', 251 patch_storage='rietveld',
186 api.raw_io.stream_output('tools/run-perf-test.cfg')) + 252 patchset='20001',
187 api.override_step_data('load config', api.json.output(config_json)) 253 issue='12345',
188 + api.step_data('Performance Test (With Patch) 1 of 1', 254 is_test=True,
189 retcode=1)) 255 rietveld="https://codereview.chromium.org") +
256 api.override_step_data(
257 'git diff to analyze patch',
258 api.raw_io.stream_output('tools/run-perf-test.cfg')) +
190 259
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))
191 config_json.update({'good_revision': '306475', 267 config_json.update({'good_revision': '306475',
192 'bad_revision': '306476'}) 268 'bad_revision': '306476'})
193 269
194 yield ( 270 yield (
195 api.test('basic_perf_tryjob_with_revisions_' + buildername) + 271 api.test('basic_perf_tryjob_with_revisions_' + buildername) +
196 api.properties.tryserver( 272 api.properties.tryserver(
197 mastername='tryserver.chromium.perf', 273 mastername='tryserver.chromium.perf',
198 buildername=buildername) + api.override_step_data( 274 buildername=buildername,
199 'git diff to analyze patch', 275 patch_storage='rietveld',
200 api.raw_io.stream_output('tools/run-perf-test.cfg')) + 276 patchset='20001',
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')) +
201 api.override_step_data('load config', api.json.output(config_json)) + 283 api.override_step_data('load config', api.json.output(config_json)) +
202 api.step_data('resolving commit_pos ' + config_json['good_revision'], 284 api.step_data('resolving commit_pos ' + config_json['good_revision'],
203 stdout=api.raw_io.output( 285 stdout=api.raw_io.output(
204 'hash:d49c331def2a3bbf3ddd0096eb51551155')) + 286 'hash:d49c331def2a3bbf3ddd0096eb51551155')) +
205 api.step_data('resolving commit_pos ' + config_json['bad_revision'], 287 api.step_data('resolving commit_pos ' + config_json['bad_revision'],
206 stdout=api.raw_io.output( 288 stdout=api.raw_io.output(
207 'hash:bad49c331def2a3bbf3ddd0096eb51551155')) + 289 '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)) +
208 api.step_data( 295 api.step_data(
209 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1', 296 'Performance Test (d49c331def2a3bbf3ddd0096eb51551155) 1 of 1',
210 stdout=api.raw_io.output(results_without_patch)) + 297 stdout=api.raw_io.output(results_without_patch)) +
211 api.step_data( 298 api.step_data(
212 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1', 299 'Performance Test (bad49c331def2a3bbf3ddd0096eb51551155) 1 of 1',
213 stdout=api.raw_io.output(results_with_patch))) 300 stdout=api.raw_io.output(results_with_patch)))
214 301
215 config_json = { 302 config_json = {
216 'max_time_minutes': '25', 303 'max_time_minutes': '25',
217 'repeat_count': '1', 304 'repeat_count': '1',
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 buildername=buildername) + api.step_data( 360 buildername=buildername) + api.step_data(
274 'saving url to temp file', 361 'saving url to temp file',
275 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data( 362 stdout=api.raw_io.output('/tmp/dummy1')) + api.step_data(
276 'saving json to temp file', 363 'saving json to temp file',
277 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties( 364 stdout=api.raw_io.output('/tmp/dummy2')) + api.properties(
278 bisect_config=bisect_config) + api.properties( 365 bisect_config=bisect_config) + api.properties(
279 job_name='f7a7b4135624439cbd27fdd5133d74ec') + 366 job_name='f7a7b4135624439cbd27fdd5133d74ec') +
280 api.bisect_tester(tempfile='/tmp/dummy') + 367 api.bisect_tester(tempfile='/tmp/dummy') +
281 api.properties(parent_got_revision='1111111') + api.properties( 368 api.properties(parent_got_revision='1111111') + api.properties(
282 parent_build_archive_url='gs://test-domain/test-archive.zip')) 369 parent_build_archive_url='gs://test-domain/test-archive.zip'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698