提交 1ef9cae2 编写于 作者: O Oliver Gondža

[FIXED JENKINS-18367] Use non-zero return code in case list-jobs CLI command fails

上级 5bc00fff
......@@ -75,7 +75,7 @@ public class ListJobsCommand extends CLICommand {
// No view and no item group with the given name found.
else {
stderr.println("No view or item group with the given name found");
jobs = Collections.emptyList();
return -1;
}
}
}
......
......@@ -58,8 +58,7 @@ public class ListJobsCommandTest {
when(jenkins.getView(null)).thenReturn(null);
when(jenkins.getItemByFullName(null)).thenReturn(null);
// TODO: One would expect -1 here
assertThat(runWith("NoSuchViewOrItemGroup"), equalTo(0));
assertThat(runWith("NoSuchViewOrItemGroup"), equalTo(-1));
assertThat(stdout, is(empty()));
assertThat(stderr, is(not(empty())));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册