Only run recipe simulation tests if infra/ changes.
authormtklein <mtklein@chromium.org>
Wed, 27 Jul 2016 11:14:07 +0000 (04:14 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 27 Jul 2016 11:14:07 +0000 (04:14 -0700)
This should lessen the need for mortals to have coverage.py,
and saves 1.8s (of 3.6s) on my desktop for this non-infra change.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187713002

Review-Url: https://codereview.chromium.org/2187713002

PRESUBMIT.py

index a3af9e4..e0e01fb 100644 (file)
@@ -172,6 +172,10 @@ def _ToolFlags(input_api, output_api):
 def _RecipeSimulationTest(input_api, output_api):
   """Run the recipe simulation test."""
   results = []
+  if not any(f.LocalPath().startswith('infra')
+             for f in input_api.AffectedFiles()):
+    return results
+
   recipes_py = os.path.join('infra', 'bots', 'recipes.py')
   cmd = ['python', recipes_py, 'simulation_test']
   try: