One-of constraint applied to TaskStep

This commit is contained in:
Kris De Volder
2017-01-28 18:41:27 -08:00
parent 4254f38e95
commit 8f9057cc5f
2 changed files with 5 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(taskStep, "image", t_ne_string);
addProp(taskStep, "input_mapping", f.ymap(t_ne_string, t_resource_name));
addProp(taskStep, "output_mapping", t_string_params);
taskStep.requireOneOf("config", "file");
YBeanType aggregateStep = f.ybean("AggregateStep");
YBeanType doStep = f.ybean("DoStep");

View File

@@ -114,6 +114,7 @@ public class ConcourseEditorTest {
" tags: a-single-string\n"
);
editor.assertProblems(
"task: a-task\n tags: a-single-string|One of [config, file] is required",
"a-single-string|Expecting a 'Sequence'"
);
@@ -483,6 +484,7 @@ public class ConcourseEditorTest {
" - get: sts4\n" +
" - get: bogus-get\n" +
" - task: do-stuff\n" +
" file: some-file.yml\n" +
" input_mapping:\n" +
" task-input: bogus-input\n" +
" repo: sts4\n" +
@@ -622,6 +624,7 @@ public class ConcourseEditorTest {
" plan:\n" +
" - get: git-repo\n" +
" - task: run-build\n" +
" file: some-task.yml\n" +
" - put: build-artefact\n" +
"- name: test\n" +
" plan:\n" +
@@ -647,6 +650,7 @@ public class ConcourseEditorTest {
" plan:\n" +
" - get: git-repo\n" +
" - task: run-build\n" +
" file: tasks/some-task.yml\n" +
" - put: build-artefact\n" +
"- name: test\n" +
" plan:\n" +