Skip to content

Commit

Permalink
(#5490) Move deprecated v1alpha1.KameletBinding tests to v1.Pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler authored and squakez committed Jun 13, 2024
1 parent 31fe95d commit cc125d2
Show file tree
Hide file tree
Showing 44 changed files with 108 additions and 123 deletions.
4 changes: 0 additions & 4 deletions e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# yaks run -v ./e2e/yaks/common/apache-kamelet-catalog/kamelet.feature

config:
namespace:
temporary: true
Expand Down
4 changes: 2 additions & 2 deletions e2e/yaks/common/kamelet-beans/kamelet-beans.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Kamelets can declare local beans

Scenario: Kamelets templates can use beans
Given bind Kamelet beans-source to uri log:info
When create KameletBinding binding
Then KameletBinding binding should be available
When create Pipe binding
Then Pipe binding should be available
Then Camel K integration binding should be running
Then Camel K integration binding should print Bean time is 0!

This file was deleted.

15 changes: 0 additions & 15 deletions e2e/yaks/common/kamelet-binding/kamelet-binding.feature

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: event-binding
name: event-pipe
spec:
source:
ref:
Expand All @@ -40,4 +40,4 @@ spec:
name: event-sink
dataTypes:
in:
format: "text-plain"
format: "text-plain"
14 changes: 7 additions & 7 deletions e2e/yaks/common/kamelet-data-types/kamelet-data-types.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Feature: Kamelets with data types
| delayBetweenAttempts | 4000 |

Scenario: Kamelet event data type conversion
Given load KameletBinding event-binding.yaml
Given Camel K integration event-binding is running
Then Camel K integration event-binding should print BodyType: byte[], Body: Hello from Camel K!
Then Camel K integration event-binding should print BodyType: String, Body: Hello from Camel K!
Given load Pipe event-pipe.yaml
Given Camel K integration event-pipe is running
Then Camel K integration event-pipe should print BodyType: byte[], Body: Hello from Camel K!
Then Camel K integration event-pipe should print BodyType: String, Body: Hello from Camel K!

Scenario: Kamelet timer-to-log conversion
Given load KameletBinding timer-to-log.yaml
Given load Pipe timer-to-log.yaml
Given Camel K integration timer-to-log is running
Then Camel K integration timer-to-log should print BodyType: byte[], Body: Hello from Camel K!
Then Camel K integration timer-to-log should print BodyType: String, Body: Hello from Camel K!

Scenario: Remove resources
Given delete KameletBinding event-binding
Given delete KameletBinding timer-to-log
Given delete Pipe event-pipe
Given delete Pipe timer-to-log
4 changes: 2 additions & 2 deletions e2e/yaks/common/kamelet-data-types/timer-to-log.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: timer-to-log
spec:
Expand Down
2 changes: 1 addition & 1 deletion e2e/yaks/common/kamelet-data-types/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ config:
- name: INTEGRATION_LOGS
level: INFO
resources:
- event-binding.yaml
- event-pipe.yaml
- timer-to-log.yaml
pre:
- name: installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ from:
Scenario: Bind Kamelet to service
Given create Kubernetes service greeting-service with target port 8080
And bind Kamelet no-props-source to uri log:info
When create KameletBinding no-props-source-uri
Then KameletBinding no-props-source-uri should be available
When create Pipe no-props-source-uri
Then Pipe no-props-source-uri should be available
Then Camel K integration no-props-source-uri should be running
Then Camel K integration no-props-source-uri should print Hello World

Scenario: Remove resources
Given delete Kubernetes service greeting-service
Given delete KameletBinding no-props-source-uri
Given delete Pipe no-props-source-uri
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Feature: Camel K can load specific secrets for Kamelets
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: KameletBinding can load specific settings for Kamelet
Scenario: Pipe can load specific settings for Kamelet
Given create Kubernetes service stub-service-2 with target port 8080
And bind Kamelet timer-source to uri http://stub-service-2.${YAKS_NAMESPACE}.svc.cluster.local/specific
And KameletBinding source properties
And Pipe source properties
| id | specific |
When create KameletBinding binding-specific
Then KameletBinding binding-specific should be available
When create Pipe binding-specific
Then Pipe binding-specific should be available

Scenario: Verify specific binding
Given HTTP server "stub-service-2"
And HTTP server timeout is 600000 ms
Then expect HTTP request body: specific
And receive POST /specific
And delete KameletBinding binding-specific
And delete Pipe binding-specific
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Feature: Camel K can load default secrets for Kamelets
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: KameletBinding can load default settings for Kamelet
Scenario: Pipe can load default settings for Kamelet
Given create Kubernetes service stub-service with target port 8080
And bind Kamelet timer-source to uri http://stub-service.${YAKS_NAMESPACE}.svc.cluster.local/default
When create KameletBinding binding
Then KameletBinding binding should be available
When create Pipe binding
Then Pipe binding should be available

Scenario: Verify default binding
Given HTTP server "stub-service"
Expand All @@ -21,4 +21,4 @@ Feature: Camel K can load default secrets for Kamelets

Scenario: Remove resources
Given delete Kubernetes service stub-service
Given delete KameletBinding binding
Given delete Pipe binding
14 changes: 14 additions & 0 deletions e2e/yaks/common/kamelet-pipe-broker/kamelet-pipe-broker.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: Camel K can bind Kamelets to the broker

Background:
Given Camel K resource polling configuration
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: Sending event to the custom broker with Pipe
Given Camel K integration logger-sink-pipe is running
Then Camel K integration logger-sink-pipe should print message: Hello Custom Event from sample-broker

Scenario: Remove resources
Given delete Camel K integration timer-source-pipe
Given delete Camel K integration logger-sink-pipe
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: logger-sink-binding-br
name: logger-sink-pipe
spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: timer-source-binding-br
name: timer-source-pipe
spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ pre:
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-br.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-binding-br.yaml -n $YAKS_NAMESPACE
kubectl wait kameletbinding timer-source-binding-br --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
kubectl wait kameletbinding logger-sink-binding-br --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
kubectl apply -f timer-source-pipe.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-pipe.yaml -n $YAKS_NAMESPACE
kubectl wait pipe timer-source-pipe --for=condition=Ready --timeout=5m -n $YAKS_NAMESPACE
kubectl wait pipe logger-sink-pipe --for=condition=Ready --timeout=5m -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Feature: Camel K can bind Kamelets via HTTP
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: KameletBinding to a HTTP URI should use CloudEvents
Scenario: Pipe 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

Scenario: Remove resources
Given delete Camel K integration display
Given delete KameletBinding timer-source-binding-display
Given delete Pipe timer-source-pipe
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: timer-source-binding-display
name: timer-source-pipe
spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
# limitations under the License.
# ---------------------------------------------------------------------------

# Run integration test:
#
# yaks run -v ./e2e/yaks/common/kamelet-binding-http/kamelet-binding-http.feature

config:
namespace:
temporary: true
Expand All @@ -28,8 +24,8 @@ pre:
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kamel run display.yaml -w -n $YAKS_NAMESPACE
cat timer-source-binding-display.yaml | sed 's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
kubectl wait pipe timer-source-binding-display --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
cat timer-source-pipe.yaml | sed 's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
kubectl wait pipe timer-source-pipe --for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Ensure that Kamelets support multiline configuration

Scenario: Wait for binding to start
Given create Kubernetes service probe-service with target port 8080
Then Camel K integration properties-binding should be running
Then Camel K integration properties-pipe should be running

Scenario: Verify binding
Given HTTP server "probe-service"
Expand All @@ -26,4 +26,4 @@ Feature: Ensure that Kamelets support multiline configuration

Scenario: Remove resources
Given delete Kubernetes service probe-service
Given delete KameletBinding properties-binding
Given delete Pipe properties-pipe
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
# limitations under the License.
# ---------------------------------------------------------------------------

kind: KameletBinding
apiVersion: camel.apache.org/v1alpha1
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: properties-binding
name: properties-pipe

spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pre:
- name: installation
run: |
kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
kubectl apply -f properties-binding.yaml -n $YAKS_NAMESPACE
kubectl apply -f properties-pipe.yaml -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
16 changes: 16 additions & 0 deletions e2e/yaks/common/kamelet-pipe/kamelet-pipe.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: Camel K can bind Kamelets

Background:
Given Camel K resource polling configuration
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: Running integration using a simple Kamelet with Pipes
Given Camel K integration timer-source-pipe is running
Given Camel K integration logger-sink-pipe is running
Then Camel K integration logger-sink-pipe should print message: Hello Kamelets

Scenario: Remove resources
Given delete Camel K integration timer-source-pipe
Given delete Camel K integration logger-sink-pipe

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: logger-sink-binding-kb
name: logger-sink-pipe
spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: timer-source-binding-kb
name: timer-source-pipe
spec:
source:
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ pre:
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-kb.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-binding-kb.yaml -n $YAKS_NAMESPACE
kubectl wait kameletbinding timer-source-binding-kb --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl wait kameletbinding logger-sink-binding-kb --for=condition=Ready --timeout=10m -n $YAKS_NAMESPACE
kubectl apply -f timer-source-pipe.yaml -n $YAKS_NAMESPACE
kubectl apply -f logger-sink-pipe.yaml -n $YAKS_NAMESPACE
kubectl wait pipe timer-source-pipe --for=condition=Ready --timeout=5m -n $YAKS_NAMESPACE
kubectl wait pipe logger-sink-pipe --for=condition=Ready --timeout=5m -n $YAKS_NAMESPACE
post:
- name: print dump
if: env:CI=true && failure()
Expand Down
13 changes: 13 additions & 0 deletions e2e/yaks/common/kamelet-steps/kamelet-steps.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Pipe can have multiple processing steps

Background:
Given Camel K resource polling configuration
| maxAttempts | 40 |
| delayBetweenAttempts | 3000 |

Scenario: Data is transformed by the steps
Given Camel K integration steps-pipe is running
Then Camel K integration steps-pipe should print Hello Apache Camel

Scenario: Remove resources
Given delete Camel K integration steps-pipe
Loading

0 comments on commit cc125d2

Please sign in to comment.