This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new bbaec4e12 [TEST] Test container command
bbaec4e12 is described below

commit bbaec4e121af0711ecdb00fddd3b24825b790cfe
Author: Jan Bouska <[email protected]>
AuthorDate: Mon Aug 8 13:31:52 2022 +0200

    [TEST] Test container command
---
 e2e/namespace/native/native_test.go | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/e2e/namespace/native/native_test.go 
b/e2e/namespace/native/native_test.go
index f2b10692c..3c6533289 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -24,6 +24,7 @@ package native
 
 import (
        "os"
+       "strings"
        "testing"
 
        . "github.com/onsi/gomega"
@@ -86,6 +87,7 @@ func TestNativeIntegrations(t *testing.T) {
 
                        // Check the Integration is ready
                        Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), 
TestTimeoutShort).Should(WithTransform(getContainerCommand(), 
ContainSubstring("java")))
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
 
                        Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -102,6 +104,7 @@ func TestNativeIntegrations(t *testing.T) {
 
                        // Check the Integration is still ready
                        Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), 
TestTimeoutShort).Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-.+-runner.*")))
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
 
                        Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -111,3 +114,11 @@ func TestNativeIntegrations(t *testing.T) {
                Expect(Kamel("delete", "--all", "-n", 
ns).Execute()).To(Succeed())
        })
 }
+
+func getContainerCommand() func(pod *corev1.Pod) string {
+       return func(pod *corev1.Pod) string {
+               cmd := strings.Join(pod.Spec.Containers[0].Command, " ")
+               cmd = cmd + strings.Join(pod.Spec.Containers[0].Args, " ")
+               return cmd
+       }
+}

Reply via email to