This is an automated email from the ASF dual-hosted git repository. tsato pushed a commit to branch release-1.9.x in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit a4b142b3d08c303356c425e5aa5d4522b9101bf7 Author: Tadayoshi Sato <sato.tadayo...@gmail.com> AuthorDate: Wed May 25 18:19:44 2022 +0900 fix(e2e): stabilise service trait test --- e2e/common/traits/service_test.go | 5 ++--- e2e/support/test_support.go | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/e2e/common/traits/service_test.go b/e2e/common/traits/service_test.go index 0ee3569c6..a8016e1ba 100644 --- a/e2e/common/traits/service_test.go +++ b/e2e/common/traits/service_test.go @@ -52,9 +52,8 @@ func TestServiceTrait(t *testing.T) { "-t", "service.enabled=true", "-t", "service.node-port=true").Execute()).To(Succeed()) Eventually(IntegrationPodPhase(ns, "platform-http-server"), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) - service := Service(ns, "platform-http-server") - Eventually(service, TestTimeoutShort).ShouldNot(BeNil()) - Expect(service().Spec.Type).Should(Equal(corev1.ServiceTypeNodePort)) + Eventually(Service(ns, "platform-http-server"), TestTimeoutShort).ShouldNot(BeNil()) + Eventually(ServiceType(ns, "platform-http-server"), TestTimeoutShort).Should(Equal(corev1.ServiceTypeNodePort)) Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) }) diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 4f95e83bb..f337ec7a3 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -558,6 +558,16 @@ func Service(ns string, name string) func() *corev1.Service { } } +func ServiceType(ns string, name string) func() corev1.ServiceType { + return func() corev1.ServiceType { + svc := Service(ns, name)() + if svc == nil { + return "" + } + return svc.Spec.Type + } +} + func Route(ns string, name string) func() *routev1.Route { return func() *routev1.Route { route := routev1.Route{}