Skip to content

Commit

Permalink
Merge branch 'master' into fixLambdaTimeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmcintosh authored Nov 12, 2024
2 parents 7d4b90c + 9e2d2c6 commit 88e219f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class StartStageHandler(
try {
// Set the startTime in case we throw an exception.
stage.startTime = clock.millis()
repository.storeStage(stage)
stage.plan()
stage.status = RUNNING
repository.storeStage(stage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("updates the stage status") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.status).isEqualTo(RUNNING)
assertThat(it.startTime).isEqualTo(clock.millis())
Expand All @@ -171,7 +171,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches tasks to the stage") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.tasks.size).isEqualTo(1)
it.tasks.first().apply {
Expand Down Expand Up @@ -222,7 +222,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("updates the stage status") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.status).isEqualTo(RUNNING)
assertThat(it.startTime).isEqualTo(clock.millis())
Expand Down Expand Up @@ -267,7 +267,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("updates the stage status") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.status).isEqualTo(RUNNING)
assertThat(it.startTime).isEqualTo(clock.millis())
Expand Down Expand Up @@ -312,7 +312,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
afterGroup(::resetMocks)

it("attaches tasks to the stage") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.tasks.size).isEqualTo(3)
it.tasks[0].apply {
Expand Down Expand Up @@ -702,7 +702,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("starts the stage") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.type).isEqualTo("bar")
assertThat(it.status).isEqualTo(RUNNING)
Expand All @@ -712,7 +712,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches a task to the stage") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.tasks.size).isEqualTo(1)
it.tasks.first().apply {
Expand Down Expand Up @@ -793,12 +793,20 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches the exception to the stage context") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.context["exception"]).isEqualTo(exceptionDetails)
}
)
}

it("updates the stage with a non-default start time") {
verify(repository).storeStage(
check {
assertThat(it.startTime).isPositive()
}
)
}
}

and("only the branch should fail") {
Expand All @@ -825,20 +833,28 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches the exception to the stage context") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.context["exception"]).isEqualTo(exceptionDetails)
}
)
}

it("attaches flag to the stage context to indicate that before stage planning failed") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.context["beforeStagePlanningFailed"]).isEqualTo(true)
}
)
}

it("updates the stage with a non-default start time") {
verify(repository).storeStage(
check {
assertThat(it.startTime).isPositive()
}
)
}
}

and("the branch should be allowed to continue") {
Expand All @@ -865,20 +881,28 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches the exception to the stage context") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.context["exception"]).isEqualTo(exceptionDetails)
}
)
}

it("attaches flag to the stage context to indicate that before stage planning failed") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.context["beforeStagePlanningFailed"]).isEqualTo(true)
}
)
}

it("updates the stage with a non-default start time") {
verify(repository).storeStage(
check {
assertThat(it.startTime).isPositive()
}
)
}
}
}

Expand Down Expand Up @@ -929,7 +953,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("updates the stage status") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.status).isEqualTo(RUNNING)
assertThat(it.startTime).isEqualTo(clock.millis())
Expand All @@ -938,7 +962,7 @@ object StartStageHandlerTest : SubjectSpek<StartStageHandler>({
}

it("attaches tasks to the stage") {
verify(repository, times(2)).storeStage(
verify(repository).storeStage(
check {
assertThat(it.tasks.size).isEqualTo(1)
it.tasks.first().apply {
Expand Down

0 comments on commit 88e219f

Please sign in to comment.