Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resubmitting last unsuccessful build instead of last failed build #451

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void afterDisconnect(final SlaveComputer computer, final TaskListener lis

final List<Action> actions = new ArrayList<>();
if (task instanceof WorkflowJob) {
final WorkflowRun failedBuild = ((WorkflowJob) task).getLastFailedBuild();
final WorkflowRun failedBuild = ((WorkflowJob) task).getLastUnsuccessfulBuild();
actions.addAll(failedBuild.getActions(ParametersAction.class));
}
if (executable instanceof Actionable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void taskCompleted_should_resubmit_task_with_actions() {
@Test
public void taskCompleted_should_resubmit_task_with_failed_build_actions() {
when(subTask1.getOwnerTask()).thenReturn(workflowJob);
when(workflowJob.getLastFailedBuild()).thenReturn(workflowRun);
when(workflowJob.getLastUnsuccessfulBuild()).thenReturn(workflowRun);
when(workflowRun.getActions(any())).thenReturn((Collections.singletonList(action1)));
when(computer.getExecutors()).thenReturn(Arrays.asList(executor1));
new EC2FleetAutoResubmitComputerLauncher(baseComputerLauncher)
Expand Down