Skip to content

Commit

Permalink
fix(after stages): make sure anything downstream of a no-op stage runs
Browse files Browse the repository at this point in the history
  • Loading branch information
robfletcher committed Mar 29, 2018
1 parent ece0181 commit 12f80a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CompleteStageHandler(
stage.includeExpressionEvaluationSummary()
repository.storeStage(stage)

if (stage.status in listOf(SUCCEEDED, FAILED_CONTINUE)) {
if (stage.status in listOf(SUCCEEDED, FAILED_CONTINUE, SKIPPED)) {
stage.startNext()
} else {
queue.push(CancelStage(message))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ object CompleteStageHandlerTest : SubjectSpek<CompleteStageHandler>({
status = RUNNING
type = emptyStage.type
}
stage {
refId = "2"
type = singleTaskStage.type
name = "downstream"
requisiteStageRefIds = setOf("1")
}
}

val message = CompleteStage(pipeline.stageByRef("1"))
Expand All @@ -468,6 +474,10 @@ object CompleteStageHandlerTest : SubjectSpek<CompleteStageHandler>({
assertThat(it.status).isEqualTo(SKIPPED)
})
}

it("starts anything downstream") {
verify(queue).push(StartStage(pipeline.stageByRef("2")))
}
}

setOf(TERMINAL, CANCELED).forEach { taskStatus ->
Expand Down

0 comments on commit 12f80a5

Please sign in to comment.