Skip to content

Commit

Permalink
fix(core): cascade Integration error when kit in...
Browse files Browse the repository at this point in the history
Error state.

Closes apache#3412
  • Loading branch information
squakez committed Jan 19, 2023
1 parent aec6973 commit 38b8f36
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions e2e/global/common/integration_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,28 @@ func TestBadRouteIntegration(t *testing.T) {
})
})
}

func TestMissingDependencyIntegration(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
operatorID := "camel-k-missing-dependencies"
Expect(KamelInstallWithID(operatorID, ns).Execute()).To(Succeed())

t.Run("run missing dependency java route", func(t *testing.T) {
RegisterTestingT(t)
name := "java-route"
Expect(KamelRunWithID(operatorID, ns, "files/Java.java", "--name", name, "-d", "mvn:com.example:nonexistent:1.0").Execute()).To(Succeed())
// Integration in error
Eventually(IntegrationPhase(ns, name), TestTimeoutLong).Should(Equal(v1.IntegrationPhaseError))
kitName := IntegrationKit(ns, name)()
// Kit in error
Eventually(KitPhase(ns, kitName), TestTimeoutShort).Should(Equal(v1.IntegrationKitPhaseError))
//Build in error with 5 attempts
build := Build(ns, kitName)()
Eventually(build.Status.Phase, TestTimeoutShort).Should(Equal(v1.BuildPhaseError))
Eventually(build.Status.Failure.Recovery.Attempt, TestTimeoutShort).Should(Equal(5))
})

// Clean up
Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
})
}

0 comments on commit 38b8f36

Please sign in to comment.