Skip to content

Commit

Permalink
Add test for earthquake source
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Mar 12, 2021
1 parent eaaa703 commit c30d45d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ on:

env:
CAMEL_K_VERSION: 1.3.1
YAKS_VERSION: 0.2.0
YAKS_VERSION: 0.3.0

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions earthquake-source.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "source"
camel.apache.org/kamelet.verified: "true"
spec:
definition:
title: Earthquake Source
Expand Down
21 changes: 21 additions & 0 deletions test/earthquake-source/earthquake-source.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: Kamelet earthquake-source works

Background:
Given Disable auto removal of Kamelet resources
Given Disable auto removal of Kubernetes resources
Given Camel-K resource polling configuration
| maxAttempts | 60 |
| delayBetweenAttempts | 3000 |

Scenario: Bind Kamelet to service
Given create Kubernetes service test-service with target port 8080
And bind Kamelet earthquake-source to uri http://test-service.${YAKS_NAMESPACE}.svc.cluster.local/test
When create KameletBinding earthquake-source-uri
Then KameletBinding earthquake-source-uri should be available

Scenario: Verify binding
Given HTTP server "test-service"
And HTTP server timeout is 120000 ms
Then expect HTTP request header: Content-Type="application/json;charset=UTF-8"
And receive POST /test
And delete KameletBinding earthquake-source-uri
27 changes: 27 additions & 0 deletions test/earthquake-source/yaks-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

config:
namespace:
temporary: true
pre:
- name: installation
run: |
# Install required Kamelets (these steps may be done globally in future versions)
kamel install -n $YAKS_NAMESPACE
kubectl apply -f ../../earthquake-source.kamelet.yaml -n $YAKS_NAMESPACE

0 comments on commit c30d45d

Please sign in to comment.