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 | 5 |
6 """Top-level presubmit script for Skia. | 6 """Top-level presubmit script for Skia. |
7 | 7 |
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
9 for more details about the presubmit API built into gcl. | 9 for more details about the presubmit API built into gcl. |
10 """ | 10 """ |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 'nanobench_flags.py' in x.LocalPath()) | 165 'nanobench_flags.py' in x.LocalPath()) |
166 for f in input_api.AffectedSourceFiles(sources): | 166 for f in input_api.AffectedSourceFiles(sources): |
167 if 0 != subprocess.call(['python', f.LocalPath(), 'test']): | 167 if 0 != subprocess.call(['python', f.LocalPath(), 'test']): |
168 results.append(output_api.PresubmitError('`python %s test` failed' % f)) | 168 results.append(output_api.PresubmitError('`python %s test` failed' % f)) |
169 return results | 169 return results |
170 | 170 |
171 | 171 |
172 def _RecipeSimulationTest(input_api, output_api): | 172 def _RecipeSimulationTest(input_api, output_api): |
173 """Run the recipe simulation test.""" | 173 """Run the recipe simulation test.""" |
174 results = [] | 174 results = [] |
| 175 if not any(f.LocalPath().startswith('infra') |
| 176 for f in input_api.AffectedFiles()): |
| 177 return results |
| 178 |
175 recipes_py = os.path.join('infra', 'bots', 'recipes.py') | 179 recipes_py = os.path.join('infra', 'bots', 'recipes.py') |
176 cmd = ['python', recipes_py, 'simulation_test'] | 180 cmd = ['python', recipes_py, 'simulation_test'] |
177 try: | 181 try: |
178 subprocess.check_output(cmd) | 182 subprocess.check_output(cmd) |
179 except subprocess.CalledProcessError as e: | 183 except subprocess.CalledProcessError as e: |
180 results.append(output_api.PresubmitError( | 184 results.append(output_api.PresubmitError( |
181 '`%s` failed:\n%s' % (' '.join(cmd), e.output))) | 185 '`%s` failed:\n%s' % (' '.join(cmd), e.output))) |
182 return results | 186 return results |
183 | 187 |
184 | 188 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 state and an error if it is in 'Closed' state. | 536 state and an error if it is in 'Closed' state. |
533 """ | 537 """ |
534 results = [] | 538 results = [] |
535 results.extend(_CommonChecks(input_api, output_api)) | 539 results.extend(_CommonChecks(input_api, output_api)) |
536 results.extend( | 540 results.extend( |
537 _CheckTreeStatus(input_api, output_api, json_url=( | 541 _CheckTreeStatus(input_api, output_api, json_url=( |
538 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) | 542 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) |
539 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) | 543 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) |
540 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) | 544 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) |
541 return results | 545 return results |
OLD | NEW |