Merge "Tags in workflows were not being properly checked"
This commit is contained in:
commit
82d5d10f89
@ -38,7 +38,8 @@ class WorkflowSpec(base.BaseSpec):
|
||||
"input": types.UNIQUE_STRING_OR_ONE_KEY_DICT_LIST,
|
||||
"output": types.NONEMPTY_DICT,
|
||||
"output-on-error": types.NONEMPTY_DICT,
|
||||
"vars": types.NONEMPTY_DICT
|
||||
"vars": types.NONEMPTY_DICT,
|
||||
"tags": types.UNIQUE_STRING_LIST
|
||||
},
|
||||
"required": ["tasks"],
|
||||
"additionalProperties": False
|
||||
|
@ -425,3 +425,22 @@ class WorkflowSpecValidation(base.WorkflowSpecValidationTestCase):
|
||||
"Workflow name cannot be in the format of UUID",
|
||||
str(exception)
|
||||
)
|
||||
|
||||
def test_tags(self):
|
||||
tests = [
|
||||
({'tags': ''}, True),
|
||||
({'tags': []}, True),
|
||||
({'tags': ['']}, True),
|
||||
({'tags': ['tag']}, False),
|
||||
({'tags': ['tag', 'tag']}, True),
|
||||
({'tags': None}, True)
|
||||
]
|
||||
|
||||
for wf_tags, expect_error in tests:
|
||||
overlay = {'test': wf_tags}
|
||||
|
||||
self._parse_dsl_spec(
|
||||
add_tasks=True,
|
||||
changes=overlay,
|
||||
expect_error=expect_error
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user