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

Side by Side Diff: PRESUBMIT.py

Issue 2398263003: Added unittests for run_slave (Closed)
Patch Set: cosmetic fixes with more readable code Created 4 years, 2 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 | slave/tests/run_slave_test.py » ('j') | slave/tests/run_slave_test.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 buildbot. 5 """Top-level presubmit script for buildbot.
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 built into git cl. 8 details on the presubmit API built into git cl.
9 """ 9 """
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 recipe_modules_tests = input_api.glob( 120 recipe_modules_tests = input_api.glob(
121 join('scripts', 'slave', 'recipe_modules', '*', 'tests')) 121 join('scripts', 'slave', 'recipe_modules', '*', 'tests'))
122 for path in recipe_modules_tests: 122 for path in recipe_modules_tests:
123 tests.extend(input_api.canned_checks.GetUnitTestsInDirectory( 123 tests.extend(input_api.canned_checks.GetUnitTestsInDirectory(
124 input_api, 124 input_api,
125 output_api, 125 output_api,
126 path, 126 path,
127 whitelist)) 127 whitelist))
128 128
129 tests.extend(input_api.canned_checks.GetUnitTestsInDirectory(
130 input_api,
131 output_api,
132 input_api.os_path.join(
133 'slave', 'tests'),
dsansome 2016/10/12 03:54:04 I'd put this on the line above
ddoman1 2016/10/12 20:08:17 Done.
134 whitelist))
135
129 with pythonpath(infra_path + sys.path): 136 with pythonpath(infra_path + sys.path):
130 import common.master_cfg_utils # pylint: disable=F0401 137 import common.master_cfg_utils # pylint: disable=F0401
131 # Fetch recipe dependencies once in serial so that we don't hit a race 138 # Fetch recipe dependencies once in serial so that we don't hit a race
132 # condition where multiple tests are trying to fetch at once. 139 # condition where multiple tests are trying to fetch at once.
133 output = input_api.RunTests([input_api.Command( 140 output = input_api.RunTests([input_api.Command(
134 name='recipes fetch', 141 name='recipes fetch',
135 cmd=[input_api.python_executable, 142 cmd=[input_api.python_executable,
136 input_api.os_path.join('scripts', 'slave', 'recipes.py'), 'fetch'], 143 input_api.os_path.join('scripts', 'slave', 'recipes.py'), 'fetch'],
137 kwargs={}, 144 kwargs={},
138 message=output_api.PresubmitError, 145 message=output_api.PresubmitError,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 def CheckChangeOnUpload(input_api, output_api): 190 def CheckChangeOnUpload(input_api, output_api):
184 return [] # Try-jobs/commit-queue do a better job of testing, faster. 191 return [] # Try-jobs/commit-queue do a better job of testing, faster.
185 192
186 193
187 def CheckChangeOnCommit(input_api, output_api): 194 def CheckChangeOnCommit(input_api, output_api):
188 output = CommonChecks(input_api, output_api) 195 output = CommonChecks(input_api, output_api)
189 output.extend(ConditionalChecks(input_api, output_api)) 196 output.extend(ConditionalChecks(input_api, output_api))
190 output.extend(CommitChecks(input_api, output_api)) 197 output.extend(CommitChecks(input_api, output_api))
191 output.extend(BuildInternalCheck(output, input_api, output_api)) 198 output.extend(BuildInternalCheck(output, input_api, output_api))
192 return output 199 return output
OLDNEW
« no previous file with comments | « no previous file | slave/tests/run_slave_test.py » ('j') | slave/tests/run_slave_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698