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

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

Issue 1773933002: Use the crrev recipe module to fetch commit hashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Update other bisect & bisect_test recipe expectations 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 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',
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 min_rev = range_data[0]['hash'] 251 min_rev = range_data[0]['hash']
252 max_rev = range_data[-1]['hash'] 252 max_rev = range_data[-1]['hash']
253 output = [[r['hash'], 'ignored'] for r in range_data[1:-1]] 253 output = [[r['hash'], 'ignored'] for r in range_data[1:-1]]
254 step_name = ('Expanding revision range.for revisions %s:%s' % 254 step_name = ('Expanding revision range.for revisions %s:%s' %
255 (min_rev, max_rev)) 255 (min_rev, max_rev))
256 return api.step_data(step_name, stdout=api.json.output(output)) 256 return api.step_data(step_name, stdout=api.json.output(output))
257 257
258 258
259 def _get_step_data_for_revision(api, revision_data, skip_results=False): 259 def _get_step_data_for_revision(api, revision_data, skip_results=False):
260 """Generator that produces step patches for fake results.""" 260 """Generator that produces step patches for fake results."""
261 commit_pos = revision_data['commit_pos'] 261 commit_pos_number = revision_data['commit_pos']
262 commit_hash = revision_data['hash'] 262 commit_hash = revision_data['hash']
263 test_results = revision_data['test_results'] 263 test_results = revision_data['test_results']
264 264
265 if 'refrange' in revision_data: 265 if 'refrange' in revision_data:
266 parent_step = 'Resolving reference range.' 266 parent_step = 'Resolving reference range.'
267 step_name = parent_step + 'resolving commit_pos ' + commit_pos 267 commit_pos = 'refs/heads/master@{#%s}' % commit_pos_number
RobertoCN 2016/03/11 18:40:23 Question: what's the difference between this strin
qyearsley 2016/03/11 18:57:50 There shouldn't be any difference -- and I think i
qyearsley 2016/03/11 20:07:02 File ".../recipes/bisect.py", line 268, in _get_st
268 yield api.step_data(step_name, stdout=api.raw_io.output('hash:' + 268 step_name = parent_step + 'crrev get commit hash for ' + commit_pos
269 commit_hash)) 269 yield api.step_data(
270 step_name,
271 stdout=api.json.output({'git_sha': commit_hash}))
270 272
271 if not skip_results: 273 if not skip_results:
272 step_name = ('Waiting for chromium@%s.gsutil ' 274 step_name = ('Waiting for chromium@%s.gsutil '
273 'Get test results for build %s') % (commit_hash[:10], 275 'Get test results for build %s') % (commit_hash[:10],
274 commit_hash) 276 commit_hash)
275 if 'refrange' in revision_data: 277 if 'refrange' in revision_data:
276 parent_step = 'Gathering reference values.' 278 parent_step = 'Gathering reference values.'
277 else: 279 else:
278 parent_step = 'Working on revision %s.' % ('chromium@' + commit_hash[:10]) 280 parent_step = 'Working on revision %s.' % ('chromium@' + commit_hash[:10])
279 yield _get_post_bisect_step_data(api, parent_step) 281 yield _get_post_bisect_step_data(api, parent_step)
280 step_name = parent_step + step_name 282 step_name = parent_step + step_name
281 yield api.step_data(step_name, stdout=api.raw_io.output(json.dumps( 283 yield api.step_data(step_name, stdout=api.raw_io.output(json.dumps(
282 test_results))) 284 test_results)))
283 285
284 if 'cl_info' in revision_data: 286 if 'cl_info' in revision_data:
285 step_name = 'Reading culprit cl information.' 287 step_name = 'Reading culprit cl information.'
286 stdout = api.json.output(revision_data['cl_info']) 288 stdout = api.json.output(revision_data['cl_info'])
287 yield api.step_data(step_name, stdout=stdout) 289 yield api.step_data(step_name, stdout=stdout)
288 290
289 291
290 def _get_post_bisect_step_data(api, parent_step=''): 292 def _get_post_bisect_step_data(api, parent_step=''):
291 """Gets step data for perf_dashboard/resource/post_json.py.""" 293 """Gets step data for perf_dashboard/resource/post_json.py."""
292 response = {'status_code': 200} 294 response = {'status_code': 200}
293 return api.step_data(parent_step + 'Post bisect results', 295 return api.step_data(parent_step + 'Post bisect results',
294 stdout=api.json.output(response)) 296 stdout=api.json.output(response))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698