Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 0 additions & 122 deletions e2e/advanced/operator_id_filtering_test.go

This file was deleted.

10 changes: 6 additions & 4 deletions e2e/common/misc/scale_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,16 @@ func TestIntegrationScale(t *testing.T) {
// Save resources by deleting the integration
g.Expect(Kamel(t, ctx, "delete", name, "-n", ns).Execute()).To(Succeed())

g.Expect(KamelRun(t, ctx, ns, "files/Java.java", "--name", "pre-built", "-t", fmt.Sprintf("container.image=%s", image)).Execute()).To(Succeed())
g.Expect(KamelRun(t, ctx, ns, "files/Java.java",
"--name", "pre-built",
"-t", fmt.Sprintf("container.image=%s", image),
).Execute()).To(Succeed())
g.Eventually(IntegrationPhase(t, ctx, ns, "pre-built"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationPodPhase(t, ctx, ns, "pre-built"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Expect(ScaleIntegration(t, ctx, ns, "pre-built", 0)).To(Succeed())
g.Eventually(IntegrationPod(t, ctx, ns, "pre-built"), TestTimeoutMedium).Should(BeNil())
g.Eventually(IntegrationPod(t, ctx, ns, "pre-built")).Should(BeNil())
g.Expect(ScaleIntegration(t, ctx, ns, "pre-built", 1)).To(Succeed())
g.Eventually(IntegrationPhase(t, ctx, ns, "pre-built"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationPodPhase(t, ctx, ns, "pre-built"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationPodPhase(t, ctx, ns, "pre-built")).Should(Equal(corev1.PodRunning))
})
})
}
8 changes: 2 additions & 6 deletions e2e/common/misc/structured_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package common

import (
"context"
"fmt"
"testing"

. "github.com/onsi/gomega"
Expand All @@ -40,20 +39,17 @@ func TestStructuredLogs(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
name := RandomizedSuffixName("java")
g.Expect(KamelRun(t, ctx, ns, "files/Java.java", "--name", name).Execute()).To(Succeed())
g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))

pod := OperatorPodGlobal(t, ctx)()
g.Expect(pod).NotTo(BeNil())

// pod.Namespace could be different from ns if using global operator
fmt.Printf("Fetching logs for operator pod %s in namespace %s", pod.Name, pod.Namespace)
logOptions := &corev1.PodLogOptions{
Container: "camel-k-operator",
}
logs, err := StructuredLogs(t, ctx, pod.Namespace, pod.Name, logOptions, false)
g.Expect(err).To(BeNil())
g.Expect(err).NotTo(HaveOccurred())
g.Expect(logs).NotTo(BeEmpty())
})
}
4 changes: 2 additions & 2 deletions e2e/common/traits/init_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestInitContainerTrait(t *testing.T) {
"init-containers.init-tasks=init;alpine;/bin/sh -c \"echo helloInit >> /tmp/init\"",
"--name",
name).Execute()).To(Succeed())
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady)).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationPodPhase(t, ctx, ns, name)).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationLogs(t, ctx, ns, name)).Should(ContainSubstring("helloInit"))
Expand All @@ -62,7 +62,7 @@ func TestInitContainerTrait(t *testing.T) {
"init-containers.sidecar-tasks=sidecar;alpine;/bin/sh -c \"for i in $(seq 1 10); do echo helloSidecar$i > /tmp/sidecar_$i.txt; sleep 1; done\"",
"--name",
name).Execute()).To(Succeed())
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady)).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationPodPhase(t, ctx, ns, name)).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationLogs(t, ctx, ns, name)).Should(ContainSubstring("helloSidecar10"))
Expand Down
2 changes: 1 addition & 1 deletion e2e/common/traits/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestPortsServiceTrait(t *testing.T) {
"-t", "service.ports=hello;85;8085",
"--name", name,
).Execute()).To(Succeed())
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady)).
g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
// We cannot use the health trait to make sure the application is ready to
// get requests as we're sharing the service port.
Expand Down
25 changes: 16 additions & 9 deletions e2e/knative/kamelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@ func TestKameletChange(t *testing.T) {
timerSource := "my-timer-source"
g.Expect(CreateTimerKamelet(t, ctx, ns, timerSource)()).To(Succeed())
g.Expect(CreateKnativeChannel(t, ctx, ns, knChannel)()).To(Succeed())

// Consumer route that will read from the Knative channel
g.Expect(KamelRun(t, ctx, ns, "files/test-kamelet-display.yaml", "-w").Execute()).To(Succeed())
g.Eventually(IntegrationPodPhase(t, ctx, ns, "test-kamelet-display")).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, "test-kamelet-display", v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))

// Create the Pipe
g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf, "-p", "source.message=HelloKnative!",
"--trait", "health.enabled=true", "--trait", "health.readiness-initial-delay=10", "--name", timerPipe).Execute()).To(Succeed())
g.Eventually(IntegrationPodPhase(t, ctx, ns, timerPipe)).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf,
"-p", "source.message=HelloKnative!",
"--name", timerPipe,
).Execute()).To(Succeed())
g.Eventually(IntegrationConditionStatus(t, ctx, ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))

// Consume the message
g.Eventually(IntegrationLogs(t, ctx, ns, "test-kamelet-display"), TestTimeoutShort).Should(ContainSubstring("HelloKnative!"))

Expand All @@ -66,11 +71,13 @@ func TestKameletChange(t *testing.T) {
))

// Update the Pipe
g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf, "-p", "source.message=message is Hi",
"--trait", "health.enabled=true", "--trait", "health.readiness-initial-delay=10", "--name", timerPipe).Execute()).To(Succeed())
g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf,
"-p", "source.message=message is Hi",
"--name", timerPipe,
).Execute()).To(Succeed())

g.Eventually(IntegrationPodPhase(t, ctx, ns, timerPipe), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationConditionStatus(t, ctx, ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ctx, ns, "test-kamelet-display"), TestTimeoutShort).Should(ContainSubstring("message is Hi"))

g.Eventually(PipeCondition(t, ctx, ns, timerPipe, v1.PipeConditionReady), TestTimeoutMedium).
Expand Down
Loading