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 2020/03/04 15:06:03 UTC

[camel-k] branch master updated: Add e2e test for the multiple files scenario #1320

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


The following commit(s) were added to refs/heads/master by this push:
     new 9b8c6e0  Add e2e test for the multiple files scenario #1320
9b8c6e0 is described below

commit 9b8c6e0382ea11697dd3ca874bf55645353670d5
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Tue Mar 3 13:28:39 2020 +0100

    Add e2e test for the multiple files scenario #1320
---
 e2e/files/js-polyglot.js     | 21 +++++++++++++++++++++
 e2e/files/yaml-polyglot.yaml | 28 ++++++++++++++++++++++++++++
 e2e/run_test.go              |  9 +++++++++
 3 files changed, 58 insertions(+)

diff --git a/e2e/files/js-polyglot.js b/e2e/files/js-polyglot.js
new file mode 100644
index 0000000..235655e
--- /dev/null
+++ b/e2e/files/js-polyglot.js
@@ -0,0 +1,21 @@
+// 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.
+
+from('timer:js?period=1s')
+    .routeId('js')
+    .setHeader("m").constant("polyglot-js")
+    .setBody()
+        .simple('Magic${header.m}')
+    .to('log:info')
\ No newline at end of file
diff --git a/e2e/files/yaml-polyglot.yaml b/e2e/files/yaml-polyglot.yaml
new file mode 100644
index 0000000..ca08ce3
--- /dev/null
+++ b/e2e/files/yaml-polyglot.yaml
@@ -0,0 +1,28 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- from:
+    uri: "timer:yaml"
+    parameters:
+      period: "5s"
+    steps:
+      - set-header:
+          name: "m"
+          constant: "polyglot-yaml"
+      - set-body:
+          simple: "Magic${header.m}"
+      - to: "log:info"
diff --git a/e2e/run_test.go b/e2e/run_test.go
index ae3911d..1e1d887 100644
--- a/e2e/run_test.go
+++ b/e2e/run_test.go
@@ -97,5 +97,14 @@ func TestRunSimpleExamples(t *testing.T) {
 			Expect(kamel("delete", "--all", "-n", ns).Execute()).Should(BeNil())
 		})
 
+		t.Run("run polyglot", func(t *testing.T) {
+			RegisterTestingT(t)
+			Expect(kamel("run", "-n", ns, "--name", "polyglot", "files/js-polyglot.js", "files/yaml-polyglot.yaml").Execute()).Should(BeNil())
+			Eventually(integrationPodPhase(ns, "polyglot"), testTimeoutMedium).Should(Equal(v1.PodRunning))
+			Eventually(integrationLogs(ns, "polyglot"), testTimeoutShort).Should(ContainSubstring("Magicpolyglot-yaml"))
+			Eventually(integrationLogs(ns, "polyglot"), testTimeoutShort).Should(ContainSubstring("Magicpolyglot-js"))
+			Expect(kamel("delete", "--all", "-n", ns).Execute()).Should(BeNil())
+		})
+
 	})
 }