Fix spurrious 'does not interact with resource error'

See: https://www.pivotaltracker.com/story/show/150337510
This commit is contained in:
Kris De Volder
2017-08-17 12:13:09 -07:00
parent 5ac7eb5d4d
commit 56e8b5e008
2 changed files with 32 additions and 2 deletions

View File

@@ -157,8 +157,13 @@ public class ConcourseModel {
}
private static final YamlTraversal JobModel_GET_PUT_STEP_PATH = new YamlPath()
.then(valueAt("plan"))
.then(anyChild().repeatAtLeast(1))
.then(
valueAt("plan")
.or(valueAt("on_success"))
.or(valueAt("on_failure"))
.or(valueAt("ensure"))
)
.then(anyChild().repeat())
.has(keyAt("get").or(keyAt("put")));
/**

View File

@@ -3914,6 +3914,31 @@ public class ConcourseEditorTest {
editor.assertProblems(/*NONE*/);
}
@Test public void bug_150337510() throws Exception {
//See: https://www.pivotaltracker.com/story/show/150337510
Editor editor = harness.newEditor(
"resources:\n" +
"- name: test\n" +
" type: s3\n" +
" source:\n" +
" bucket: blah\n" +
" regexp: blah/blah*.tar.gz\n" +
"jobs:\n" +
"- name: build-it\n" +
" plan:\n" +
" - task: build-it\n" +
" file: tasks/build-it.yml\n" +
" on_success:\n" +
" put: test\n" +
"- name: create-website\n" +
" plan:\n" +
" - get: test\n" +
" passed:\n" +
" - build-it"
);
editor.assertProblems(/*NONE*/);
}
//////////////////////////////////////////////////////////////////////////////
private void assertContextualCompletions(String conText, String textBefore, String... textAfter) throws Exception {