OLD | NEW |
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 """Top-level presubmit script for src/components/cronet. | 5 """Top-level presubmit script for src/components/cronet. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 | 73 |
74 def _RunUnittests(input_api, output_api): | 74 def _RunUnittests(input_api, output_api): |
75 return input_api.canned_checks.RunUnitTestsInDirectory( | 75 return input_api.canned_checks.RunUnitTestsInDirectory( |
76 input_api, output_api, '.', [ r'^.+_unittest\.py$']) | 76 input_api, output_api, '.', [ r'^.+_unittest\.py$']) |
77 | 77 |
78 | 78 |
79 def CheckChangeOnUpload(input_api, output_api): | 79 def CheckChangeOnUpload(input_api, output_api): |
80 results = [] | 80 results = [] |
81 results.extend(_PyLintChecks(input_api, output_api)) | 81 results.extend(_PyLintChecks(input_api, output_api)) |
82 results.extend( | |
83 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) | |
84 results.extend(_PackageChecks(input_api, output_api)) | 82 results.extend(_PackageChecks(input_api, output_api)) |
85 results.extend(_RunUnittests(input_api, output_api)) | 83 results.extend(_RunUnittests(input_api, output_api)) |
86 return results | 84 return results |
87 | 85 |
88 | 86 |
89 def CheckChangeOnCommit(input_api, output_api): | 87 def CheckChangeOnCommit(input_api, output_api): |
90 return _RunUnittests(input_api, output_api) | 88 return _RunUnittests(input_api, output_api) |
91 | 89 |
92 | 90 |
93 def _GetTryMasters(project, change): | 91 def _GetTryMasters(project, change): |
(...skipping 30 matching lines...) Expand all Loading... |
124 new_description = description | 122 new_description = description |
125 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join( | 123 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join( |
126 '%s:%s' % (master, ','.join(bots)) | 124 '%s:%s' % (master, ','.join(bots)) |
127 for master, bots in masters.iteritems()) | 125 for master, bots in masters.iteritems()) |
128 results.append(output_api.PresubmitNotifyResult( | 126 results.append(output_api.PresubmitNotifyResult( |
129 'Automatically added Cronet trybot to run tests on CQ.')) | 127 'Automatically added Cronet trybot to run tests on CQ.')) |
130 | 128 |
131 rietveld_obj.update_description(issue, new_description) | 129 rietveld_obj.update_description(issue, new_description) |
132 | 130 |
133 return results | 131 return results |
OLD | NEW |