You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2021/04/12 13:56:48 UTC

[camel-k] 05/06: chore: split yaks tests

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

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

commit b3c59094690fc70048ce39c083630cf1f80903e4
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Fri Apr 9 16:30:57 2021 +0200

    chore: split yaks tests
---
 .../display.groovy                                 |  0
 .../kamelet.feature                                |  6 +--
 .../timer-source-binding-display.yaml              |  0
 .../timer-source.kamelet.yaml}                     | 43 +++++++++++++++++-----
 .../yaks-config.yaml                               |  9 -----
 e2e/yaks/common/kamelet-binding/kamelet.feature    |  5 ---
 e2e/yaks/common/kamelet-binding/yaks-config.yaml   |  4 --
 7 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/e2e/yaks/common/kamelet-binding/display.groovy b/e2e/yaks/common/kamelet-binding-http/display.groovy
similarity index 100%
rename from e2e/yaks/common/kamelet-binding/display.groovy
rename to e2e/yaks/common/kamelet-binding-http/display.groovy
diff --git a/e2e/yaks/common/kamelet-binding/kamelet.feature b/e2e/yaks/common/kamelet-binding-http/kamelet.feature
similarity index 59%
copy from e2e/yaks/common/kamelet-binding/kamelet.feature
copy to e2e/yaks/common/kamelet-binding-http/kamelet.feature
index fa93a2e..4430823 100644
--- a/e2e/yaks/common/kamelet-binding/kamelet.feature
+++ b/e2e/yaks/common/kamelet-binding-http/kamelet.feature
@@ -1,14 +1,10 @@
-Feature: Camel K can bind Kamelets
+Feature: Camel K can bind Kamelets via HTTP
 
   Background:
     Given Camel-K resource polling configuration
       | maxAttempts          | 40   |
       | delayBetweenAttempts | 3000 |
 
-  Scenario: Running integration using a simple Kamelet with KameletBinding
-    Given Camel-K integration logger-sink-binding is running
-    Then Camel-K integration logger-sink-binding should print message: Hello Kamelets
-
   Scenario: Binding to a HTTP URI should use CloudEvents
     Given Camel-K integration display is running
     Then Camel-K integration display should print type: org.apache.camel.event
diff --git a/e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml b/e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml
similarity index 100%
copy from e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml
copy to e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml
diff --git a/e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml b/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml
similarity index 56%
rename from e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml
rename to e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml
index 91cbf37..a08cecf 100644
--- a/e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml
+++ b/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml
@@ -16,16 +16,39 @@
 # ---------------------------------------------------------------------------
 
 apiVersion: camel.apache.org/v1alpha1
-kind: KameletBinding
+kind: Kamelet
 metadata:
-  name: timer-source-binding-display
+  name: timer-source
+  labels:
+    camel.apache.org/kamelet.type: "source"
 spec:
-  source:
-    ref:
-      kind: Kamelet
-      apiVersion: camel.apache.org/v1alpha1
-      name: timer-source
+  definition:
+    title: "Timer"
+    description: "Produces periodic events with a custom payload"
+    required:
+      - message
     properties:
-      message: Hello
-  sink:
-    uri: http://display.{namespace}.svc.cluster.local
+      period:
+        title: Period
+        description: The time interval between two events
+        type: integer
+        default: 1000
+      message:
+        title: Message
+        description: The message to generate
+        type: string
+  types:
+    out:
+      mediaType: application/json
+      schema:
+        id: text.camel.apache.org
+        type: string
+  flow:
+    from:
+      uri: timer:tick
+      parameters:
+        period: "{{period}}"
+      steps:
+        - set-body:
+            constant: "{{message}}"
+        - to: "kamelet:sink"
diff --git a/e2e/yaks/common/kamelet-binding/yaks-config.yaml b/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
similarity index 74%
copy from e2e/yaks/common/kamelet-binding/yaks-config.yaml
copy to e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
index 1e0370b..de3709b 100644
--- a/e2e/yaks/common/kamelet-binding/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
@@ -23,16 +23,7 @@ pre:
   run: |
     kamel install -n $YAKS_NAMESPACE
 
-    kubectl apply -f messages-channel.yaml -n $YAKS_NAMESPACE
-
     kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
-    kubectl apply -f logger-sink.kamelet.yaml -n $YAKS_NAMESPACE
-
-    kubectl apply -f timer-source-binding.yaml -n $YAKS_NAMESPACE
-    kubectl apply -f logger-sink-binding.yaml -n $YAKS_NAMESPACE
-
-    kubectl wait kameletbinding timer-source-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
-    kubectl wait kameletbinding logger-sink-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
 
     kamel run display.groovy -w -n $YAKS_NAMESPACE
     cat timer-source-binding-display.yaml | sed  's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
diff --git a/e2e/yaks/common/kamelet-binding/kamelet.feature b/e2e/yaks/common/kamelet-binding/kamelet.feature
index fa93a2e..3cf7775 100644
--- a/e2e/yaks/common/kamelet-binding/kamelet.feature
+++ b/e2e/yaks/common/kamelet-binding/kamelet.feature
@@ -8,8 +8,3 @@ Feature: Camel K can bind Kamelets
   Scenario: Running integration using a simple Kamelet with KameletBinding
     Given Camel-K integration logger-sink-binding is running
     Then Camel-K integration logger-sink-binding should print message: Hello Kamelets
-
-  Scenario: Binding to a HTTP URI should use CloudEvents
-    Given Camel-K integration display is running
-    Then Camel-K integration display should print type: org.apache.camel.event
-    Then Camel-K integration display should print Hello
diff --git a/e2e/yaks/common/kamelet-binding/yaks-config.yaml b/e2e/yaks/common/kamelet-binding/yaks-config.yaml
index 1e0370b..a75bafe 100644
--- a/e2e/yaks/common/kamelet-binding/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet-binding/yaks-config.yaml
@@ -33,7 +33,3 @@ pre:
 
     kubectl wait kameletbinding timer-source-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
     kubectl wait kameletbinding logger-sink-binding --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
-
-    kamel run display.groovy -w -n $YAKS_NAMESPACE
-    cat timer-source-binding-display.yaml | sed  's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
-    kubectl wait kameletbinding timer-source-binding-display --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE