Add infra_tests.py, recipe, buildbotless bot
Have the presubmit (upload) run infra_tests.py if anything in infra/ changed.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2415193002
Review-Url: https://codereview.chromium.org/2415193002
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f0b5f42..a6d1d16 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -167,32 +167,14 @@
return results
-def _RecipeSimulationTest(input_api, output_api):
- """Run the recipe simulation test."""
+def _InfraTests(input_api, output_api):
+ """Run the infra tests."""
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:
- subprocess.check_output(cmd)
- except subprocess.CalledProcessError as e:
- results.append(output_api.PresubmitError(
- '`%s` failed:\n%s' % (' '.join(cmd), e.output)))
- return results
-
-
-def _GenTasksTest(input_api, output_api):
- """Run gen_tasks.go test."""
- results = []
- if not any(f.LocalPath().startswith('infra')
- for f in input_api.AffectedFiles()):
- return results
-
- gen_tasks = os.path.join('infra', 'bots', 'gen_tasks.go')
- cmd = ['go', 'run', gen_tasks, '--test']
+ cmd = ['python', os.path.join('infra', 'bots', 'infra_tests.py')]
try:
subprocess.check_output(cmd)
except subprocess.CalledProcessError as e:
@@ -254,8 +236,7 @@
results.extend(_CommonChecks(input_api, output_api))
# Run on upload, not commit, since the presubmit bot apparently doesn't have
# coverage or Go installed.
- results.extend(_RecipeSimulationTest(input_api, output_api))
- results.extend(_GenTasksTest(input_api, output_api))
+ results.extend(_InfraTests(input_api, output_api))
results.extend(_CheckGNFormatted(input_api, output_api))
return results