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

Side by Side Diff: scripts/slave/recipes/bisect.py

Issue 2013133002: Avoid nesting steps called under waiting for x: (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Hiding changes behind optional parameter Created 4 years, 6 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 base64 5 import base64
6 import collections 6 import collections
7 import json 7 import json
8 8
9 DEPS = [ 9 DEPS = [
10 'auto_bisect', 10 'auto_bisect',
11 'recipe_engine/properties', 11 'recipe_engine/properties',
12 'test_utils', 12 'test_utils',
13 'chromium_tests', 13 'chromium_tests',
14 'recipe_engine/raw_io', 14 'recipe_engine/raw_io',
15 'recipe_engine/step', 15 'recipe_engine/step',
16 'halt', 16 'halt',
17 'recipe_engine/json', 17 'recipe_engine/json',
18 ] 18 ]
19 19
20 def RunSteps(api): 20 def RunSteps(api):
21 mastername = api.m.properties.get('mastername') 21 mastername = api.m.properties.get('mastername')
22 buildername = api.m.properties.get('buildername') 22 buildername = api.m.properties.get('buildername')
23 # TODO(akuegel): Explicitly load the configs for the builders and don't rely 23 # TODO(akuegel): Explicitly load the configs for the builders and don't rely
24 # on builders.py in chromium_tests recipe module. 24 # on builders.py in chromium_tests recipe module.
25 bot_config = api.chromium_tests.create_bot_config_object( 25 bot_config = api.chromium_tests.create_bot_config_object(
26 mastername, buildername) 26 mastername, buildername)
27 api.chromium_tests.configure_build(bot_config) 27 api.chromium_tests.configure_build(bot_config)
28 api.m.chromium_tests.prepare_checkout(bot_config) 28 api.m.chromium_tests.prepare_checkout(bot_config)
29 api.auto_bisect.perform_bisect() 29 api.auto_bisect.perform_bisect(do_not_nest_wait_for_revision=True)
30 30
31 def GenTests(api): 31 def GenTests(api):
32 basic_test = api.test('basic') 32 basic_test = api.test('basic')
33 broken_bad_rev_test = api.test('broken_bad_revision_test') 33 broken_bad_rev_test = api.test('broken_bad_revision_test')
34 broken_good_rev_test = api.test('broken_good_revision_test') 34 broken_good_rev_test = api.test('broken_good_revision_test')
35 return_code_test = api.test('basic_return_code_test') 35 return_code_test = api.test('basic_return_code_test')
36 basic_test += api.properties.generic( 36 basic_test += api.properties.generic(
37 mastername='tryserver.chromium.perf', 37 mastername='tryserver.chromium.perf',
38 buildername='linux_perf_bisect') 38 buildername='linux_perf_bisect')
39 broken_bad_rev_test += api.properties.generic( 39 broken_bad_rev_test += api.properties.generic(
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 if 'refrange' in revision_data: 266 if 'refrange' in revision_data:
267 parent_step = 'Resolving reference range.' 267 parent_step = 'Resolving reference range.'
268 commit_pos = 'refs/heads/master@{#%s}' % commit_pos_number 268 commit_pos = 'refs/heads/master@{#%s}' % commit_pos_number
269 step_name = parent_step + 'crrev get commit hash for ' + commit_pos 269 step_name = parent_step + 'crrev get commit hash for ' + commit_pos
270 yield api.step_data( 270 yield api.step_data(
271 step_name, 271 step_name,
272 stdout=api.json.output({'git_sha': commit_hash})) 272 stdout=api.json.output({'git_sha': commit_hash}))
273 273
274 if not skip_results: 274 if not skip_results:
275 step_name = ('Waiting for chromium@%s.gsutil ' 275 step_name = ('gsutil Get test results for build %s') % (commit_hash)
276 'Get test results for build %s') % (commit_hash[:10],
277 commit_hash)
278 if 'refrange' in revision_data: 276 if 'refrange' in revision_data:
279 parent_step = 'Gathering reference values.' 277 parent_step = 'Gathering reference values.'
280 else: 278 else:
281 parent_step = 'Working on revision %s.' % ('chromium@' + commit_hash[:10]) 279 parent_step = 'Working on revision %s.' % ('chromium@' + commit_hash[:10])
282 yield _get_post_bisect_step_data(api, parent_step) 280 yield _get_post_bisect_step_data(api, parent_step)
283 step_name = parent_step + step_name 281 step_name = parent_step + step_name
284 yield api.step_data(step_name, stdout=api.raw_io.output(json.dumps( 282 yield api.step_data(step_name, stdout=api.raw_io.output(json.dumps(
285 test_results))) 283 test_results)))
286 284
287 if 'cl_info' in revision_data: 285 if 'cl_info' in revision_data:
288 step_name = 'Reading culprit cl information.' 286 step_name = 'Reading culprit cl information.'
289 stdout = api.json.output(revision_data['cl_info']) 287 stdout = api.json.output(revision_data['cl_info'])
290 yield api.step_data(step_name, stdout=stdout) 288 yield api.step_data(step_name, stdout=stdout)
291 289
292 290
293 def _get_post_bisect_step_data(api, parent_step=''): 291 def _get_post_bisect_step_data(api, parent_step=''):
294 """Gets step data for perf_dashboard/resource/post_json.py.""" 292 """Gets step data for perf_dashboard/resource/post_json.py."""
295 response = {'status_code': 200} 293 response = {'status_code': 200}
296 return api.step_data(parent_step + 'Post bisect results', 294 return api.step_data(parent_step + 'Post bisect results',
297 stdout=api.json.output(response)) 295 stdout=api.json.output(response))
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/local_bisect.py ('k') | scripts/slave/recipes/bisect.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698