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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/example.py

Issue 1758603004: Checking for failure in requested builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Updating expectations after rebase and sync. Yet again. Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 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 import json 5 import json
6 6
7 DEPS = [ 7 DEPS = [
8 'auto_bisect', 8 'auto_bisect',
9 'chromium_tests', 9 'chromium_tests',
10 'recipe_engine/json', 10 'recipe_engine/json',
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 api.auto_bisect.run_bisect_script('dummy_extra_src', '/dummy/path/') 67 api.auto_bisect.run_bisect_script('dummy_extra_src', '/dummy/path/')
68 68
69 69
70 def GenTests(api): 70 def GenTests(api):
71 dummy_gs_location = ('gs://chrome-perf/bisect-results/' 71 dummy_gs_location = ('gs://chrome-perf/bisect-results/'
72 'a6298e4afedbf2cd461755ea6f45b0ad64222222-test.results') 72 'a6298e4afedbf2cd461755ea6f45b0ad64222222-test.results')
73 basic_test = _make_test(api, _get_basic_test_data(), 'basic') 73 basic_test = _make_test(api, _get_basic_test_data(), 'basic')
74 yield basic_test 74 yield basic_test
75 75
76 failed_build_test = _make_test( 76 failed_build_test = _make_test(
77 api, _get_ref_range_only_test_data(), 'failed_build_test') 77 api, _get_ref_range_only_test_data(), 'failed_build_test',
78 extra_config={'dummy_builds': None})
79 failed_build_test += api.step_data('gsutil ls', retcode=1)
80 failed_build_test += api.step_data(
81 'Waiting for chromium@a6298e4afe.gsutil ls' , retcode=1)
82 failed_build_test += api.step_data(
83 'Waiting for chromium@a6298e4afe.fetch builder state',
84 stdout=api.raw_io.output('{"cachedBuilds": ["2106"]}'))
85 failed_build_test += api.step_data(
86 'Waiting for chromium@a6298e4afe.fetch build details',
87 stdout=api.raw_io.output(json.dumps({
88 'results': 2,
89 'properties': [('build_archive_url',
90 ('gs://chrome-perf/Linux Builder/full-build-linux_'
91 'a6298e4afedbf2cd461755ea6f45b0ad64222222.zip'))],
92 })))
78 yield failed_build_test 93 yield failed_build_test
79 94
95
96 delayed_build_test = _make_test(
97 api, _get_ref_range_only_test_data(), 'delayed_build_test',
98 extra_config={'dummy_builds': None})
99 delayed_build_test += api.step_data('gsutil ls', retcode=1)
100 delayed_build_test += api.step_data(
101 'Waiting for chromium@a6298e4afe.gsutil ls' , retcode=1)
102 delayed_build_test += api.step_data(
103 'Waiting for chromium@a6298e4afe.gsutil ls (2)' , retcode=1)
104 delayed_build_test += api.step_data(
105 'Waiting for chromium@a6298e4afe.gsutil ls (3)' , retcode=1)
106 delayed_build_test += api.step_data(
107 'Waiting for chromium@a6298e4afe.fetch builder state',
108 stdout=api.raw_io.output('{"cachedBuilds": []}'))
109 delayed_build_test += api.step_data(
110 'Waiting for chromium@a6298e4afe.fetch builder state (2)',
111 stdout=api.raw_io.output('{"cachedBuilds": ["2106"]}'))
112 delayed_build_test += api.step_data(
113 'Waiting for chromium@a6298e4afe.fetch build details',
114 stdout=api.raw_io.output(json.dumps({
115 'properties': [('build_archive_url',
116 ('gs://chrome-perf/Linux Builder/full-build-linux_'
117 'a6298e4afedbf2cd461755ea6f45b0ad64222222.zip'))],
118 })))
119 delayed_build_test += api.step_data(
120 'Waiting for chromium@a6298e4afe.fetch build details (2)',
121 stdout=api.raw_io.output(json.dumps({
122 'results': 2,
123 'properties': [('build_archive_url',
124 ('gs://chrome-perf/Linux Builder/full-build-linux_'
125 'a6298e4afedbf2cd461755ea6f45b0ad64222222.zip'))],
126 })))
127 yield delayed_build_test
128
80 missing_metric_test = _make_test( 129 missing_metric_test = _make_test(
81 api, _get_ref_range_only_missing_metric_test_data(), 130 api, _get_ref_range_only_missing_metric_test_data(),
82 'missing_metric_test') 131 'missing_metric_test')
83 yield missing_metric_test 132 yield missing_metric_test
84 133
85 windows_test = _make_test( 134 windows_test = _make_test(
86 api, _get_basic_test_data(), 'windows_bisector', platform='windows') 135 api, _get_basic_test_data(), 'windows_bisector', platform='windows')
87 yield windows_test 136 yield windows_test
88 137
89 winx64_test = _make_test( 138 winx64_test = _make_test(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 slavename='dummyslave') 175 slavename='dummyslave')
127 yield bisect_script_test 176 yield bisect_script_test
128 177
129 178
130 def _get_ref_range_only_test_data(): 179 def _get_ref_range_only_test_data():
131 return [ 180 return [
132 { 181 {
133 'refrange': True, 182 'refrange': True,
134 'hash': 'a6298e4afedbf2cd461755ea6f45b0ad64222222', 183 'hash': 'a6298e4afedbf2cd461755ea6f45b0ad64222222',
135 'commit_pos': '314015', 184 'commit_pos': '314015',
185 'fail_to_build': True,
136 }, 186 },
137 { 187 {
138 'refrange': True, 188 'refrange': True,
139 'hash': '00316c9ddfb9d7b4e1ed2fff9fe6d964d2111111', 189 'hash': '00316c9ddfb9d7b4e1ed2fff9fe6d964d2111111',
140 'commit_pos': '314017', 190 'commit_pos': '314017',
141 'test_results': {
142 'results': {
143 'values': [12, 13, 14, 15, 16],
144 },
145 'retcodes': [0],
146 }
147 }, 191 },
148 ] 192 ]
149 193
150 194
151 def _get_ref_range_only_missing_metric_test_data(): 195 def _get_ref_range_only_missing_metric_test_data():
152 return [ 196 return [
153 { 197 {
154 'refrange': True, 198 'refrange': True,
155 'hash': 'a6298e4afedbf2cd461755ea6f45b0ad64222222', 199 'hash': 'a6298e4afedbf2cd461755ea6f45b0ad64222222',
156 'commit_pos': '314015', 200 'commit_pos': '314015',
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 }, 326 },
283 'DEPS_change': 'True', 327 'DEPS_change': 'True',
284 "DEPS": ("vars={'v8_revision': '004'};" 328 "DEPS": ("vars={'v8_revision': '004'};"
285 "deps = {'src/v8': 'v8.git@' + Var('v8_revision')," 329 "deps = {'src/v8': 'v8.git@' + Var('v8_revision'),"
286 "'src/third_party/WebKit': 'webkit.git@010'}"), 330 "'src/third_party/WebKit': 'webkit.git@010'}"),
287 'DEPS_interval': {'v8': '002 003 004'.split()}, 331 'DEPS_interval': {'v8': '002 003 004'.split()},
288 }, 332 },
289 ] 333 ]
290 334
291 335
292 def _make_test(api, test_data, test_name, platform='linux'): 336 def _make_test(api, test_data, test_name, platform='linux', extra_config=None):
293 basic_test = api.test(test_name) 337 basic_test = api.test(test_name)
294 basic_test += _get_revision_range_step_data(api, test_data) 338 basic_test += _get_revision_range_step_data(api, test_data)
295 for revision_data in test_data: 339 for revision_data in test_data:
296 for step_data in _get_step_data_for_revision(api, revision_data): 340 for step_data in _get_step_data_for_revision(api, revision_data):
297 basic_test += step_data 341 basic_test += step_data
298 if 'win_x64' in platform: 342 if 'win_x64' in platform:
299 basic_test += api.properties(bisect_config=_get_config({ 343 basic_test += api.properties(bisect_config=_get_config({
300 'command': ('src/tools/perf/run_benchmark -v --browser=release_x64' 344 'command': ('src/tools/perf/run_benchmark -v --browser=release_x64'
301 ' smoothness.tough_scrolling_cases'), 345 ' smoothness.tough_scrolling_cases'),
302 'recipe_tester_name': 'chromium_rel_win7_x64'})) 346 'recipe_tester_name': 'chromium_rel_win7_x64'}))
303 elif 'win' in platform: 347 elif 'win' in platform:
304 basic_test += api.properties(bisect_config=_get_config( 348 basic_test += api.properties(bisect_config=_get_config(
305 {'recipe_tester_name': 'chromium_rel_win7'})) 349 {'recipe_tester_name': 'chromium_rel_win7'}))
306 elif 'mac' in platform: 350 elif 'mac' in platform:
307 basic_test += api.properties(bisect_config=_get_config( 351 basic_test += api.properties(bisect_config=_get_config(
308 {'recipe_tester_name': 'chromium_rel_mac'})) 352 {'recipe_tester_name': 'chromium_rel_mac'}))
309 elif 'android_arm64' in platform: 353 elif 'android_arm64' in platform:
310 basic_test += api.properties(bisect_config=_get_config({ 354 basic_test += api.properties(bisect_config=_get_config({
311 'command': ('src/tools/perf/run_benchmark -v --browser=android-chromium' 355 'command': ('src/tools/perf/run_benchmark -v --browser=android-chromium'
312 ' smoothness.tough_scrolling_cases'), 356 ' smoothness.tough_scrolling_cases'),
313 'recipe_tester_name': 'android-nexus9'})) 357 'recipe_tester_name': 'android-nexus9'}))
314 elif 'android' in platform: 358 elif 'android' in platform:
315 basic_test += api.properties(bisect_config=_get_config({ 359 basic_test += api.properties(bisect_config=_get_config({
316 'command': ('src/tools/perf/run_benchmark -v --browser=android-chromium' 360 'command': ('src/tools/perf/run_benchmark -v --browser=android-chromium'
317 ' smoothness.tough_scrolling_cases'), 361 ' smoothness.tough_scrolling_cases'),
318 'recipe_tester_name': 'android-nexus7'})) 362 'recipe_tester_name': 'android-nexus7'}))
319 else: 363 else:
320 basic_test += api.properties(bisect_config=_get_config()) 364 basic_test += api.properties(bisect_config=_get_config(extra_config))
321 return basic_test 365 return basic_test
322 366
323 367
324 def _get_revision_range_step_data(api, range_data): 368 def _get_revision_range_step_data(api, range_data):
325 """Adds canned output for fetch_intervening_revisions.py.""" 369 """Adds canned output for fetch_intervening_revisions.py."""
326 min_rev = range_data[0]['hash'] 370 min_rev = range_data[0]['hash']
327 max_rev = range_data[-1]['hash'] 371 max_rev = range_data[-1]['hash']
328 output = [[r['hash'], 'ignored'] for r in range_data[1:-1]] 372 output = [[r['hash'], 'ignored'] for r in range_data[1:-1]]
329 step_name = ('Expanding revision range.for revisions %s:%s' % 373 step_name = ('Expanding revision range.for revisions %s:%s' %
330 (min_rev, max_rev)) 374 (min_rev, max_rev))
(...skipping 10 matching lines...) Expand all
341 'good_revision': '314015', 385 'good_revision': '314015',
342 'bad_revision': '314017', 386 'bad_revision': '314017',
343 'metric': 'mean_input_event_latency/mean_input_event_latency', 387 'metric': 'mean_input_event_latency/mean_input_event_latency',
344 'repeat_count': '2', 388 'repeat_count': '2',
345 'max_time_minutes': '5', 389 'max_time_minutes': '5',
346 'bug_id': '', 390 'bug_id': '',
347 'gs_bucket': 'chrome-perf', 391 'gs_bucket': 'chrome-perf',
348 'builder_host': 'master4.golo.chromium.org', 392 'builder_host': 'master4.golo.chromium.org',
349 'builder_port': '8341', 393 'builder_port': '8341',
350 'dummy_builds': 'True', 394 'dummy_builds': 'True',
395 'dummy_job_names': 'True',
351 'bypass_stats_check': 'True', 396 'bypass_stats_check': 'True',
352 'skip_gclient_ops': 'True', 397 'skip_gclient_ops': 'True',
353 'recipe_tester_name': 'linux_perf_tester' 398 'recipe_tester_name': 'linux_perf_tester'
354 } 399 }
355 if params: 400 if params:
356 example_config.update(params) 401 example_config.update(params)
357 return example_config 402 return example_config
358 403
359 404
360 def _get_step_data_for_revision(api, revision_data, include_build_steps=True): 405 def _get_step_data_for_revision(api, revision_data, include_build_steps=True):
361 """Generator that produces step patches for fake results.""" 406 """Generator that produces step patches for fake results."""
362 commit_pos = revision_data['commit_pos'] 407 commit_pos = revision_data['commit_pos']
363 commit_hash = revision_data['hash'] 408 commit_hash = revision_data['hash']
364 test_results = revision_data.get('test_results') 409 test_results = revision_data.get('test_results')
365 410
366 if 'refrange' in revision_data: 411 if 'refrange' in revision_data:
367 parent_step = 'Resolving reference range.' 412 parent_step = 'Resolving reference range.'
368 step_name = parent_step + 'resolving commit_pos ' + commit_pos 413 step_name = parent_step + 'resolving commit_pos ' + commit_pos
369 yield api.step_data(step_name, 414 yield api.step_data(step_name,
370 stdout=api.raw_io.output('hash:' + commit_hash)) 415 stdout=api.raw_io.output('hash:' + commit_hash))
371 416
372
373 if include_build_steps: 417 if include_build_steps:
374 if test_results: 418 if test_results:
375 step_name = ('Waiting for chromium@%s.gsutil ' 419 step_name = ('Waiting for chromium@%s.gsutil '
376 'Get test results for build %s') % (commit_hash[:10], 420 'Get test results for build %s') % (commit_hash[:10],
377 commit_hash) 421 commit_hash)
378 yield api.step_data(step_name, stdout=api.json.output(test_results)) 422 yield api.step_data(step_name, stdout=api.json.output(test_results))
379 423
380 if revision_data.get('DEPS', False): 424 if revision_data.get('DEPS', False):
381 step_name = 'fetch file %s:DEPS' % commit_hash 425 step_name = 'fetch file %s:DEPS' % commit_hash
382 yield api.step_data(step_name, stdout=api.raw_io.output( 426 yield api.step_data(step_name, stdout=api.raw_io.output(
(...skipping 17 matching lines...) Expand all
400 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash)) 444 yield api.step_data(step_name, stdout=api.raw_io.output(file_hash))
401 step_name = 'Expanding revision range for revision %s on depot %s' 445 step_name = 'Expanding revision range for revision %s on depot %s'
402 step_name %= (interval[-1], depot_name) 446 step_name %= (interval[-1], depot_name)
403 stdout = api.json.output([(r, 0) for r in interval[:-1]]) 447 stdout = api.json.output([(r, 0) for r in interval[:-1]])
404 yield api.step_data(step_name, stdout=stdout) 448 yield api.step_data(step_name, stdout=stdout)
405 449
406 if 'cl_info' in revision_data: 450 if 'cl_info' in revision_data:
407 step_name = 'Reading culprit cl information.' 451 step_name = 'Reading culprit cl information.'
408 stdout = api.json.output(revision_data['cl_info']) 452 stdout = api.json.output(revision_data['cl_info'])
409 yield api.step_data(step_name, stdout=stdout) 453 yield api.step_data(step_name, stdout=stdout)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698