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

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

Issue 1044543002: Lint bisect-related modules; obey pylint. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebased Created 5 years, 8 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 | « no previous file | scripts/slave/recipe_modules/auto_bisect/bisect_results.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 """API for the bisect recipe module. 5 """API for the bisect recipe module.
6 6
7 This API is meant to enable the bisect recipe to bisect any chromium-supported 7 This API is meant to enable the bisect recipe to bisect any chromium-supported
8 platform for any test that can be run via buildbot, perf or otherwise. 8 platform for any test that can be run via buildbot, perf or otherwise.
9 """ 9 """
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 """ 48 """
49 self.override_poll_interval = bisect_config_dict.get('poll_sleep') 49 self.override_poll_interval = bisect_config_dict.get('poll_sleep')
50 revision_class = self._get_revision_class(bisect_config_dict['test_type']) 50 revision_class = self._get_revision_class(bisect_config_dict['test_type'])
51 return bisector.Bisector(self, bisect_config_dict, revision_class, 51 return bisector.Bisector(self, bisect_config_dict, revision_class,
52 init_revisions=not dummy_mode) 52 init_revisions=not dummy_mode)
53 53
54 def _get_revision_class(self, test_type): 54 def _get_revision_class(self, test_type):
55 """Gets the particular subclass of Revision needed for the test type.""" 55 """Gets the particular subclass of Revision needed for the test type."""
56 if test_type == 'perf': 56 if test_type == 'perf':
57 return perf_revision_state.PerfRevisionState 57 return perf_revision_state.PerfRevisionState
58 else: #pragma: no cover 58 else: # pragma: no cover
59 raise NotImplementedError() 59 raise NotImplementedError()
60 60
61 def gsutil_file_exists(self, path): 61 def gsutil_file_exists(self, path):
62 """Returns True if a file exists at the given GS path.""" 62 """Returns True if a file exists at the given GS path."""
63 try: 63 try:
64 self.m.gsutil(['ls', path]) 64 self.m.gsutil(['ls', path])
65 except self.m.step.StepFailure: #pragma: no cover 65 except self.m.step.StepFailure: # pragma: no cover
66 return False 66 return False
67 return True 67 return True
68 68
69 def query_revision_info(self, revision, git_checkout_dir=None): 69 def query_revision_info(self, revision, git_checkout_dir=None):
70 """Gathers information on a particular revision, such as author's name, 70 """Gathers information on a particular revision, such as author's name,
71 email, subject, and date. 71 email, subject, and date.
72 72
73 Args: 73 Args:
74 revision (str): Revision you want to gather information on; a git 74 revision (str): Revision you want to gather information on; a git
75 commit hash. 75 commit hash.
(...skipping 16 matching lines...) Expand all
92 separator = 'S3P4R4T0R' 92 separator = 'S3P4R4T0R'
93 formats = separator.join(['%aN', '%aE', '%s', '%cD', '%b']) 93 formats = separator.join(['%aN', '%aE', '%s', '%cD', '%b'])
94 targets = ['author', 'email', 'subject', 'date', 'body'] 94 targets = ['author', 'email', 'subject', 'date', 'body']
95 command_parts = ['log', '--format=%s' % formats, '-1', revision] 95 command_parts = ['log', '--format=%s' % formats, '-1', revision]
96 96
97 step_result = self.m.git(*command_parts, 97 step_result = self.m.git(*command_parts,
98 name='Reading culprit cl information.', 98 name='Reading culprit cl information.',
99 cwd=git_checkout_dir, 99 cwd=git_checkout_dir,
100 stdout=self.m.raw_io.output()) 100 stdout=self.m.raw_io.output())
101 return dict(zip(targets, step_result.stdout.split(separator))) 101 return dict(zip(targets, step_result.stdout.split(separator)))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/bisect_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698