Skip to content

Commit

Permalink
chore(test): Health kamelet test cleanup
Browse files Browse the repository at this point in the history
Ref #4922
  • Loading branch information
gansheer authored and squakez committed Dec 1, 2023
1 parent 0b9f247 commit fffd6c7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions e2e/common/traits/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fffd6c7

Please sign in to comment.