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

Side by Side Diff: tools/auto_bisect/bisect_results_json.py

Issue 1625573004: Update legacy bisect to post results to perf dashboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_import_path
Patch Set: update Created 4 years, 10 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
« no previous file with comments | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6
7 import bisect_utils
8 import source_control
9
10
11 def Get(bisect_results, opts, depot_registry):
12 """Returns the results as a jsonable object."""
13 if opts.bisect_mode == bisect_utils.BISECT_MODE_RETURN_CODE:
14 change = '0'
15 else:
16 metric = '/'.join(opts.metric)
17 change = '%.02f%%' % bisect_results.regression_size
18
19 status = 'completed'
20
21 return {
22 'try_job_id': opts.try_job_id,
23 'bug_id': opts.bug_id,
24 'status': status,
25 'buildbot_log_url': _GetBuildBotLogUrl(),
26 'bisect_bot': os.environ.get('BUILDBOT_BUILDERNAME', ''),
27 'command': opts.command,
28 'metric': metric,
29 'change': change,
30 'score': bisect_results.confidence,
31 'good_revision': opts.good_revision,
32 'bad_revision': opts.bad_revision,
33 'warnings': bisect_results.warnings,
34 'abort_reason': bisect_results.abort_reason,
35 'culprit_data': _CulpritData(bisect_results),
36 'revision_data': _RevisionData(bisect_results, depot_registry),
37 }
38
39
40 def _CulpritData(bisect_results):
41 if not bisect_results.culprit_revisions:
42 return None
43 cl, culprit_info, depot = bisect_results.culprit_revisions[0]
44 commit_link = _GetViewVCLinkFromDepotAndHash(cl, depot)
45 if commit_link:
46 commit_link = '\nLink : %s' % commit_link
47 else:
48 commit_link = ('\Description:\n%s' % culprit_info['body'])
49
50 return {
51 'subject': culprit_info['subject'],
52 'author': culprit_info['email'],
53 'email': culprit_info['email'],
54 'cl_date': culprit_info['date'],
55 'commit_info': commit_link,
56 'revisions_links': [],
57 'cl': cl
58 }
59
60
61 def _RevisionData(bisect_results, depot_registry):
62 revision_rows = []
63 for state in bisect_results.state.GetRevisionStates():
64 commit_position = source_control.GetCommitPosition(
65 state.revision, depot_registry.GetDepotDir(state.depot))
66 revision_rows.append({
67 'depot_name': state.depot,
68 'deps_revision': state.revision,
69 'commit_pos': commit_position,
70 'result': 'good' if state.passed else 'bad',
71 })
72 return revision_rows
73
74
75 def _GetViewVCLinkFromDepotAndHash(git_revision, depot):
76 """Gets link to the repository browser."""
77 if depot and 'viewvc' in bisect_utils.DEPOT_DEPS_NAME[depot]:
78 return bisect_utils.DEPOT_DEPS_NAME[depot]['viewvc'] + git_revision
79 return ''
80
81
82 def _GetBuildBotLogUrl():
83 master_url = os.environ.get('BUILDBOT_BUILDBOTURL')
84 builder_name = os.environ.get('BUILDBOT_BUILDERNAME')
85 builder_number = os.environ.get('BUILDBOT_BUILDNUMBER')
86 if master_url and builder_name and builder_number:
87 return '%s%s/%s' % (master_url, builder_name, builder_number)
88 return ''
OLDNEW
« no previous file with comments | « tools/auto_bisect/bisect_results.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698