From fffd6c749a1b55ca4c6f299fdfb9e175fb55af8e Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Wed, 29 Nov 2023 18:07:31 +0100 Subject: [PATCH] chore(test): Health kamelet test cleanup Ref #4922 --- e2e/common/traits/health_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/e2e/common/traits/health_test.go b/e2e/common/traits/health_test.go index 40575b5c8a..0d4656b4d5 100644 --- a/e2e/common/traits/health_test.go +++ b/e2e/common/traits/health_test.go @@ -25,11 +25,12 @@ package traits import ( "encoding/json" "fmt" - "github.com/onsi/gomega/gstruct" "strings" "testing" "time" + "github.com/onsi/gomega/gstruct" + camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" . "github.com/onsi/gomega" @@ -237,13 +238,15 @@ func TestHealthTrait(t *testing.T) { t.Run("Readiness condition with stopped binding", func(t *testing.T) { name := RandomizedSuffixName("stopped-binding") + source := RandomizedSuffixName("my-health-timer-source") + sink := RandomizedSuffixName("my-health-log-sink") - Expect(CreateTimerKamelet(ns, "my-health-timer-source")()).To(Succeed()) - Expect(CreateLogKamelet(ns, "my-health-log-sink")()).To(Succeed()) + Expect(CreateTimerKamelet(ns, source)()).To(Succeed()) + Expect(CreateLogKamelet(ns, sink)()).To(Succeed()) Expect(KamelBindWithID(operatorID, ns, - "my-health-timer-source", - "my-health-log-sink", + source, + sink, "-p", "source.message=Magicstring!", "-p", "sink.loggerName=binding", "--annotation", "trait.camel.apache.org/health.enabled=true", @@ -354,6 +357,8 @@ func TestHealthTrait(t *testing.T) { // Clean-up Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) + Expect(DeleteKamelet(ns, source)).To(Succeed()) + Expect(DeleteKamelet(ns, sink)).To(Succeed()) }) t.Run("Readiness condition with never ready route", func(t *testing.T) {