OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Top-level presubmit script for auto-bisect. | 5 """Top-level presubmit script for auto-bisect. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
8 details on the presubmit API. | 8 details on the presubmit API. |
9 """ | 9 """ |
10 | 10 |
11 import imp | 11 import imp |
12 import subprocess | 12 import subprocess |
13 import os | 13 import os |
14 | 14 |
15 # Paths to bisect config files relative to this script. | 15 # Paths to bisect config files relative to this script. |
16 CONFIG_FILES = [ | 16 CONFIG_FILES = [ |
17 'bisect.cfg', | 17 'bisect.cfg', |
18 os.path.join(os.path.pardir, 'run-perf-test.cfg'), | 18 os.path.join(os.path.pardir, 'run-perf-test.cfg'), |
19 ] | 19 ] |
20 | 20 |
| 21 |
21 def CheckChangeOnUpload(input_api, output_api): | 22 def CheckChangeOnUpload(input_api, output_api): |
22 return _CommonChecks(input_api, output_api) | 23 return _CommonChecks(input_api, output_api) |
23 | 24 |
24 | 25 |
25 def CheckChangeOnCommit(input_api, output_api): | 26 def CheckChangeOnCommit(input_api, output_api): |
26 return _CommonChecks(input_api, output_api) | 27 return _CommonChecks(input_api, output_api) |
27 | 28 |
28 | 29 |
29 def _CommonChecks(input_api, output_api): | 30 def _CommonChecks(input_api, output_api): |
30 """Does all presubmit checks for auto-bisect.""" | 31 """Does all presubmit checks for auto-bisect.""" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 def _RunPyLint(input_api, output_api): | 88 def _RunPyLint(input_api, output_api): |
88 """Runs unit tests for auto-bisect.""" | 89 """Runs unit tests for auto-bisect.""" |
89 telemetry_path = os.path.join( | 90 telemetry_path = os.path.join( |
90 input_api.PresubmitLocalPath(), os.path.pardir, 'telemetry') | 91 input_api.PresubmitLocalPath(), os.path.pardir, 'telemetry') |
91 mock_path = os.path.join( | 92 mock_path = os.path.join( |
92 input_api.PresubmitLocalPath(), os.path.pardir, os.path.pardir, | 93 input_api.PresubmitLocalPath(), os.path.pardir, os.path.pardir, |
93 'third_party', 'pymock') | 94 'third_party', 'pymock') |
94 disabled_warnings = [ | 95 disabled_warnings = [ |
95 'relative-import', | 96 'relative-import', |
96 ] | 97 ] |
97 tests = input_api.canned_checks.GetPylint( | 98 tests = input_api.canned_checks.GetPylint( |
98 input_api, output_api, disabled_warnings=disabled_warnings, | 99 input_api, output_api, disabled_warnings=disabled_warnings, |
99 extra_paths_list=[telemetry_path, mock_path]) | 100 extra_paths_list=[telemetry_path, mock_path]) |
100 return input_api.RunTests(tests) | 101 return input_api.RunTests(tests) |
OLD | NEW |