diff --git a/tools/jenkins-projects-checks.py b/tools/jenkins-projects-checks.py index a9a75ca157..4a30a5b264 100755 --- a/tools/jenkins-projects-checks.py +++ b/tools/jenkins-projects-checks.py @@ -159,6 +159,7 @@ def validate_jobs(): # NOTE(pabelanger): Make sure console-log is our last publisher # defined. We use the publisher to upload logs from zuul-launcher. result = _check_console_log_publisher(schema, entry) + result += _check_tox_builder(schema, entry) if result: print(job_file) count += result @@ -180,6 +181,25 @@ def _check_console_log_publisher(schema, entry): return count +def _check_tox_builder(schema, entry): + count = 0 + if schema == JOB or schema == JOB_TEMPLATE: + if 'builders' in entry: + for b in entry['builders']: + # Test for dict, coming from "tox:" + if isinstance(b, dict): + if 'tox' in b: + print("ERROR: Use 'run-tox' instead of 'tox' " + "builder in '%s':" % entry['name']) + count += 1 + # And test for "tox" without arguments + elif isinstance(b, str) and b == 'tox': + print("ERROR: Use 'run-tox' instead of 'tox' " + "builder in '%s':" % entry['name']) + count += 1 + return count + + def check_all(): errors = validate_jobs() errors = check_alphabetical() or errors