You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/10/24 08:30:47 UTC

[camel-k] branch release-1.8.x updated (e4d45897e -> 68c5f971e)

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

tsato pushed a change to branch release-1.8.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from e4d45897e chore(build): Update Kind cluster version
     new 507276b6a chore(e2e): native test - add warm up before native build testing
     new 6f63c75df fix(e2e): stabilise TestNativeIntegrations
     new 68c5f971e chore: regen resources

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 e2e/native/native_test.go   | 29 +++++++++++++++++++++++++----
 e2e/support/test_support.go | 31 +++++++++++++++++++++++++------
 pkg/resources/resources.go  |  4 ++--
 3 files changed, 52 insertions(+), 12 deletions(-)


[camel-k] 02/03: fix(e2e): stabilise TestNativeIntegrations

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6f63c75df4481efba17e4e8467b164222c99b1b6
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Oct 18 14:44:58 2022 +0900

    fix(e2e): stabilise TestNativeIntegrations
---
 e2e/native/native_test.go   |  7 ++++---
 e2e/support/test_support.go | 14 ++++++++++----
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/e2e/native/native_test.go b/e2e/native/native_test.go
index a5a871ecb..6cff8eabe 100644
--- a/e2e/native/native_test.go
+++ b/e2e/native/native_test.go
@@ -42,8 +42,9 @@ var (
 func TestNativeIntegrations(t *testing.T) {
 	WithNewTestNamespace(t, func(ns string) {
 		Expect(Kamel("install", "-n", ns,
-			"--build-timeout", "15m0s",
-			"--operator-resources", "limits.memory=4Gi",
+			"--build-timeout", "40m0s",
+			"--operator-resources", "limits.memory=4.5Gi",
+			"--maven-cli-option", "-Dquarkus.native.native-image-xmx=3g",
 		).Execute()).To(Succeed())
 		Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
 
@@ -107,7 +108,7 @@ func TestNativeIntegrations(t *testing.T) {
 
 			// Check the native Kit is ready
 			Eventually(Kits(ns, withNativeLayout, KitWithPhase(v1.IntegrationKitPhaseReady)),
-				TestTimeoutLong).Should(HaveLen(1))
+				TestTimeoutVeryLong).Should(HaveLen(1))
 
 			nativeKit := Kits(ns, withNativeLayout, KitWithPhase(v1.IntegrationKitPhaseReady))()[0]
 			// Check the Integration uses the native Kit
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 67afbc8d7..e4bd01442 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -28,7 +28,6 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
-	"github.com/stretchr/testify/assert"
 	"io"
 	"io/ioutil"
 	"os"
@@ -38,6 +37,8 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+
 	"github.com/apache/camel-k/pkg/platform"
 	"github.com/google/uuid"
 	"github.com/onsi/gomega"
@@ -88,6 +89,9 @@ var TestTimeoutShort = 1 * time.Minute
 var TestTimeoutMedium = 5 * time.Minute
 var TestTimeoutLong = 10 * time.Minute
 
+// TestTimeoutVeryLong should be used only for testing native builds.
+var TestTimeoutVeryLong = 40 * time.Minute
+
 var TestContext context.Context
 var testClient client.Client
 
@@ -1590,11 +1594,13 @@ func CreateTimerKamelet(ns string, name string) func() error {
 	return CreateKamelet(ns, name, flow, props, nil)
 }
 
-func BindKameletTo(ns string, name string, annotations map[string]string, from corev1.ObjectReference, to corev1.ObjectReference, sourceProperties map[string]string, sinkProperties map[string]string) func() error {
+func BindKameletTo(ns, name string, annotations map[string]string, from, to corev1.ObjectReference,
+	sourceProperties, sinkProperties map[string]string) func() error {
 	return BindKameletToWithErrorHandler(ns, name, annotations, from, to, sourceProperties, sinkProperties, nil)
 }
 
-func BindKameletToWithErrorHandler(ns string, name string, annotations map[string]string, from corev1.ObjectReference, to corev1.ObjectReference, sourceProperties map[string]string, sinkProperties map[string]string, errorHandler map[string]interface{}) func() error {
+func BindKameletToWithErrorHandler(ns, name string, annotations map[string]string, from, to corev1.ObjectReference,
+	sourceProperties, sinkProperties map[string]string, errorHandler map[string]interface{}) func() error {
 	return func() error {
 		kb := v1alpha1.NewKameletBinding(ns, name)
 		kb.Annotations = annotations
@@ -1691,7 +1697,7 @@ func WithGlobalOperatorNamespace(t *testing.T, test func(string)) {
 	if ocp {
 		// global operators are always installed in the openshift-operators namespace
 		InvokeUserTestCode(t, "openshift-operators", test)
-	}else {
+	} else {
 		// create new namespace for the global operator
 		WithNewTestNamespace(t, test)
 	}


[camel-k] 03/03: chore: regen resources

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 68c5f971ef40d715a28a3b779eaab8fd85be3791
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Oct 18 17:37:21 2022 +0900

    chore: regen resources
---
 pkg/resources/resources.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index 5f385c64f..14236bc84 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -583,9 +583,9 @@ var assets = func() http.FileSystem {
 		"/traits.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "traits.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 51544,
+			uncompressedSize: 51563,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x73\x5b\xb9\x91\xe0\xef\xf3\x57\xa0\xb4\x57\x65\xc9\x45\x52\x9e\xc9\x26\x99\xd3\xdd\x6c\x4e\x63\x7b\x12\xcd\xf8\x43\x67\x6b\x26\x9b\xf2\xb9\x42\xf0\xbd\x26\x09\xf3\x11\x78\x01\xf0\x24\x33\x97\xfb\xdf\xaf\xd0\xdd\xf8\x78\x8f\x94\x44\xd9\xd6\x6c\xb4\xb5\x9b\xaa\x1d\x4b\x7a\x00\x1a\x8d\x46\x7f\x77\xc3\x5b\xa9\xbc\x3b\xf9\x6a\x2c\xb4\x5c\xc3\x89\x90\xf3\xb9\xd2\xca\x6f\xbe\x12\xa2\x6d\xa4\x9f\x1b\xbb\x3e\x11\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x73\x5b\xb9\x91\xe0\xef\xf3\x57\xa0\xb4\x57\x65\xc9\x45\x52\x9e\xc9\x26\x99\xd3\xdd\x6c\x4e\x63\x7b\x12\xcd\xf8\x43\x67\x6b\x26\x9b\xf2\xb9\x42\xf0\xbd\x26\x09\xf3\x11\x78\x01\xf0\x24\x33\x97\xfb\xdf\xaf\xd0\xdd\xf8\x78\x8f\x94\x44\xd9\xd6\x6c\xb4\xb5\x9b\xaa\x1d\x4b\x7a\x00\x1a\x8d\x46\x7f\x77\xc3\x5b\xa9\xbc\x3b\xf9\x6a\x2c\xb4\x5c\xc3\x89\x90\xf3\xb9\xd2\xca\x6f\xbe\x12\xa2\x6d\xa4\x9f\x1b\xbb\x3e\x11\x [...]
 		},
 	}
 	fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{


[camel-k] 01/03: chore(e2e): native test - add warm up before native build testing

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 507276b6ad96fd873c8120c60ed28180fffffc92
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Thu Sep 1 14:54:46 2022 +0900

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

diff --git a/e2e/native/native_test.go b/e2e/native/native_test.go
index 72580ba4e..a5a871ecb 100644
--- a/e2e/native/native_test.go
+++ b/e2e/native/native_test.go
@@ -54,7 +54,27 @@ func TestNativeIntegrations(t *testing.T) {
 			).Execute()).To(Succeed())
 
 			Eventually(IntegrationPhase(ns, name)).Should(Equal(v1.IntegrationPhaseError))
-			Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionKitAvailable)).Should(Equal(corev1.ConditionFalse))
+			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(Kamel("run", "-n", ns, "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 1f507b8c1..67afbc8d7 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -899,6 +899,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)()
@@ -1142,8 +1156,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