| OLD | NEW |
| 1 # Copyright 2012 The LUCI Authors. All rights reserved. | 1 # Copyright 2012 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Top-level presubmit script for swarm_client. | 5 """Top-level presubmit script for swarm_client. |
| 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 gcl. | 8 details on the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 ] + sys.path | 23 ] + sys.path |
| 24 output.extend(input_api.canned_checks.RunPylint(input_api, output_api)) | 24 output.extend(input_api.canned_checks.RunPylint(input_api, output_api)) |
| 25 finally: | 25 finally: |
| 26 sys.path = sys_path_backup | 26 sys.path = sys_path_backup |
| 27 | 27 |
| 28 # These tests are touching the live infrastructure. It's a pain if your IP | 28 # These tests are touching the live infrastructure. It's a pain if your IP |
| 29 # is not whitelisted so do not run them for now. They should use a local fake | 29 # is not whitelisted so do not run them for now. They should use a local fake |
| 30 # web service instead. | 30 # web service instead. |
| 31 blacklist = [ | 31 blacklist = [ |
| 32 r'.*isolateserver_smoke_test\.py$', | 32 r'.*isolateserver_smoke_test\.py$', |
| 33 r'.*isolateserver_load_test\.py$', |
| 33 r'.*swarming_smoke_test\.py$', | 34 r'.*swarming_smoke_test\.py$', |
| 34 ] | 35 ] |
| 35 if not input_api.is_committing: | 36 if not input_api.is_committing: |
| 36 # Remove all slow tests, e.g. the ones that take >1s to complete. | 37 # Remove all slow tests, e.g. the ones that take >1s to complete. |
| 37 blacklist.extend([ | 38 blacklist.extend([ |
| 38 r'.*isolate_smoke_test\.py$', | 39 r'.*isolate_smoke_test\.py$', |
| 39 r'.*trace_inputs_smoke_test\.py$', | 40 r'.*trace_inputs_smoke_test\.py$', |
| 40 r'.*url_open_timeout_test\.py$', | 41 r'.*url_open_timeout_test\.py$', |
| 41 ]) | 42 ]) |
| 42 | 43 |
| 43 output.extend( | 44 unit_tests = input_api.canned_checks.GetUnitTestsRecursively( |
| 44 input_api.canned_checks.RunUnitTestsInDirectory( | 45 input_api, output_api, |
| 45 input_api, output_api, | 46 input_api.os_path.join(input_api.PresubmitLocalPath()), |
| 46 input_api.os_path.join(input_api.PresubmitLocalPath(), 'tests'), | 47 whitelist=[r'.+_test\.py$'], |
| 47 whitelist=[r'.+_test\.py$'], | 48 blacklist=blacklist) |
| 48 blacklist=blacklist)) | 49 output.extend(input_api.RunTests(unit_tests)) |
| 49 return output | 50 return output |
| 50 | 51 |
| 51 | 52 |
| 52 def CheckChangeOnUpload(input_api, output_api): | 53 def CheckChangeOnUpload(input_api, output_api): |
| 53 return CommonChecks(input_api, output_api) | 54 return CommonChecks(input_api, output_api) |
| 54 | 55 |
| 55 | 56 |
| 56 def CheckChangeOnCommit(input_api, output_api): | 57 def CheckChangeOnCommit(input_api, output_api): |
| 57 return CommonChecks(input_api, output_api) | 58 return CommonChecks(input_api, output_api) |
| OLD | NEW |