You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/10/07 10:40:35 UTC

[camel-k] branch release-1.10.x updated (1258ca800 -> f71cd6110)

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

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


    from 1258ca800 chore: Upgrade go.uber.org/automaxprocs to v1.5.1
     new 7df1a13dc [TEST] Extract shared functions
     new f71cd6110 [TEST] Test KameletBinding in native mode

The 2 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/namespace/native/native_binding_test.go        | 81 ++++++++++++++++++++++
 e2e/namespace/native/native_test.go                | 14 ----
 .../native_test_support.go}                        | 27 ++++----
 3 files changed, 96 insertions(+), 26 deletions(-)
 create mode 100644 e2e/namespace/native/native_binding_test.go
 copy e2e/namespace/{install/cli/version_test.go => native/native_test_support.go} (63%)


[camel-k] 01/02: [TEST] Extract shared functions

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

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

commit 7df1a13dc911687ebcd1c9aae2606d28a3c7c1cd
Author: Jan Bouska <jb...@redhat.com>
AuthorDate: Fri Sep 23 11:01:23 2022 +0200

    [TEST] Extract shared functions
---
 e2e/namespace/native/native_test.go         | 14 ---------
 e2e/namespace/native/native_test_support.go | 44 +++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/e2e/namespace/native/native_test.go b/e2e/namespace/native/native_test.go
index 3c6533289..74e2b8375 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -24,7 +24,6 @@ package native
 
 import (
 	"os"
-	"strings"
 	"testing"
 
 	. "github.com/onsi/gomega"
@@ -35,11 +34,6 @@ import (
 	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 )
 
-var (
-	withFastJarLayout = KitWithLabels(map[string]string{v1.IntegrationKitLayoutLabel: v1.IntegrationKitLayoutFastJar})
-	withNativeLayout  = KitWithLabels(map[string]string{v1.IntegrationKitLayoutLabel: v1.IntegrationKitLayoutNative})
-)
-
 func TestNativeIntegrations(t *testing.T) {
 	if os.Getenv("CAMEL_K_CLUSTER_OCP3") == "true" {
 		t.Skip("INFO: Skipping test as known to never pass on OCP3")
@@ -114,11 +108,3 @@ 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
-	}
-}
diff --git a/e2e/namespace/native/native_test_support.go b/e2e/namespace/native/native_test_support.go
new file mode 100644
index 000000000..acd37558b
--- /dev/null
+++ b/e2e/namespace/native/native_test_support.go
@@ -0,0 +1,44 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package native
+
+import (
+	corev1 "k8s.io/api/core/v1"
+	"strings"
+
+	. "github.com/apache/camel-k/e2e/support"
+	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+)
+
+var (
+	withFastJarLayout = KitWithLabels(map[string]string{v1.IntegrationKitLayoutLabel: v1.IntegrationKitLayoutFastJar})
+	withNativeLayout  = KitWithLabels(map[string]string{v1.IntegrationKitLayoutLabel: v1.IntegrationKitLayoutNative})
+)
+
+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
+	}
+}


[camel-k] 02/02: [TEST] Test KameletBinding in native mode

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

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

commit f71cd61102e820f27a013b94c9b04970c73417b2
Author: Jan Bouska <jb...@redhat.com>
AuthorDate: Fri Sep 23 11:01:49 2022 +0200

    [TEST] Test KameletBinding in native mode
---
 e2e/namespace/native/native_binding_test.go | 81 +++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/e2e/namespace/native/native_binding_test.go b/e2e/namespace/native/native_binding_test.go
new file mode 100644
index 000000000..f2af7d681
--- /dev/null
+++ b/e2e/namespace/native/native_binding_test.go
@@ -0,0 +1,81 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package native
+
+import (
+	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+	"testing"
+
+	. "github.com/onsi/gomega"
+
+	corev1 "k8s.io/api/core/v1"
+
+	. "github.com/apache/camel-k/e2e/support"
+	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+)
+
+func TestNativeBinding(t *testing.T) {
+	WithNewTestNamespace(t, func(ns string) {
+		operatorID := "camel-k-native-binding"
+		Expect(KamelInstallWithID(operatorID, ns,
+			"--build-timeout", "15m0s",
+			"--operator-resources", "limits.memory=4Gi",
+		).Execute()).To(Succeed())
+		Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+		t.Run("kamelet binding with native build", func(t *testing.T) {
+			from := corev1.ObjectReference{
+				Kind:       "Kamelet",
+				Name:       "timer-source",
+				APIVersion: v1alpha1.SchemeGroupVersion.String(),
+			}
+
+			to := corev1.ObjectReference{
+				Kind:       "Kamelet",
+				Name:       "log-sink",
+				APIVersion: v1alpha1.SchemeGroupVersion.String(),
+			}
+
+			bindingName := "native-binding"
+			message := "Magicstring!"
+			Expect(BindKameletTo(ns, bindingName, map[string]string{"trait.camel.apache.org/quarkus.package-type": "native"}, from, to, map[string]string{"message": message}, map[string]string{})()).To(Succeed())
+
+			Eventually(Kits(ns, withNativeLayout, KitWithPhase(v1.IntegrationKitPhaseReady)),
+				TestTimeoutVeryLong).Should(HaveLen(1))
+			nativeKit := Kits(ns, withNativeLayout, KitWithPhase(v1.IntegrationKitPhaseReady))()[0]
+			Eventually(IntegrationKit(ns, bindingName), TestTimeoutShort).Should(Equal(nativeKit.Name))
+
+			Eventually(IntegrationPodPhase(ns, bindingName), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+			Eventually(IntegrationLogs(ns, bindingName), TestTimeoutShort).Should(ContainSubstring(message))
+
+			Eventually(IntegrationPod(ns, bindingName), TestTimeoutShort).
+				Should(WithTransform(getContainerCommand(), MatchRegexp(".*camel-k-integration-\\d+\\.\\d+\\.\\d+[-A-Za-z]*-runner.*")))
+
+			// Clean up
+			Expect(Kamel("delete", bindingName, "-n", ns).Execute()).To(Succeed())
+		})
+
+		// Clean up
+		Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+	})
+}