Check that 'run-tox' is used instead of 'tox'
We're using now 'run-tox' as builder for tox instead of the previous 'tox' one. Add a check so that new changes do not introduce 'tox' builder again. Change-Id: I5fe91898807206b87901f8b3cefa6bc4c52ff52e
This commit is contained in:
parent
d679cf6e01
commit
0dd9b060fd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue