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

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

commit 429f133a04272d9ecc9d53a6d6fdde884f553d22
Author: Tadayoshi Sato <[email protected]>
AuthorDate: Thu Sep 1 14:54:46 2022 +0900

    chore(e2e): native test - add warm up before native build testing
---
 e2e/namespace/native/native_test.go | 16 ++++++++++++++++
 e2e/support/test_support.go         | 17 +++++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/e2e/namespace/native/native_test.go 
b/e2e/namespace/native/native_test.go
index 706306ee4..6ca81734e 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -65,8 +65,24 @@ func TestNativeIntegrations(t *testing.T) {
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionKitAvailable)).
                                Should(Equal(corev1.ConditionFalse))
 
+                               // Clean up
+                       Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+               })
+
+               t.Run("warm up before native build testing", func(t *testing.T) 
{
+                       // The following native build test is under tight time 
constraints, so here it runs
+                       // a warm up testing to make sure necessary jars are 
already downloaded.
+                       name := "warm-up-yaml"
+                       Expect(KamelRunWithID(operatorID, ns, 
"files/yaml.yaml", "--name", name).Execute()).To(Succeed())
+
+                       Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutLong).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), TestTimeoutShort).
+                               Should(Equal(corev1.ConditionTrue))
+                       Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+
                        // Clean up
                        Expect(Kamel("delete", name, "-n", 
ns).Execute()).To(Succeed())
+                       Expect(DeleteKits(ns)).To(Succeed())
                })
 
                t.Run("automatic rollout deployment from fast-jar to native 
kit", func(t *testing.T) {
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 0bb3ecc39..d5053f735 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1107,6 +1107,20 @@ func Kits(ns string, options ...interface{}) func() 
[]v1.IntegrationKit {
        }
 }
 
+func DeleteKits(ns string) error {
+       kits := Kits(ns)()
+       if len(kits) == 0 {
+               return nil
+       }
+       for _, kit := range kits {
+               if err := TestClient().Delete(TestContext, &kit); err != nil {
+                       return err
+               }
+       }
+
+       return nil
+}
+
 func OperatorImage(ns string) func() string {
        return func() string {
                pod := OperatorPod(ns)()
@@ -1360,8 +1374,7 @@ func DeletePlatform(ns string) func() bool {
                if pl == nil {
                        return true
                }
-               err := TestClient().Delete(TestContext, pl)
-               if err != nil {
+               if err := TestClient().Delete(TestContext, pl); err != nil {
                        log.Error(err, "Got error while deleting the platform")
                }
                return false

Reply via email to