You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/10/18 06:53:06 UTC
[camel-k] branch main updated (22b65a7 -> 0aa37b4)
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git.
from 22b65a7 Updated CHANGELOG.md
new 81ffb1a Kamel CLI help test was added
new 58a1c00 Kamel CLI version test was added
new c9f0dd3 Kamel CLI dump test was added
new 0aa37b4 Kamel CLI describe test was added
The 4 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/common/cli/describe_test.go | 80 ++++++++++++++++++++++
.../{languages/yaml_test.go => cli/dump_test.go} | 36 ++++++----
e2e/common/cli/help_test.go | 56 +++++++++++++++
.../test_util.go => common/cli/version_test.go} | 22 +++---
4 files changed, 169 insertions(+), 25 deletions(-)
create mode 100644 e2e/common/cli/describe_test.go
copy e2e/common/{languages/yaml_test.go => cli/dump_test.go} (60%)
create mode 100644 e2e/common/cli/help_test.go
copy e2e/{support/test_util.go => common/cli/version_test.go} (72%)
[camel-k] 01/04: Kamel CLI help test was added
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 81ffb1a9a4a7c481cc54a9dfe2f3850aeb83c2ed
Author: Vladislav Sokolovskii <vs...@redhat.com>
AuthorDate: Fri Jun 25 14:58:54 2021 +0300
Kamel CLI help test was added
---
e2e/common/cli/help_test.go | 56 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/e2e/common/cli/help_test.go b/e2e/common/cli/help_test.go
new file mode 100644
index 0000000..3f79450
--- /dev/null
+++ b/e2e/common/cli/help_test.go
@@ -0,0 +1,56 @@
+// +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 common
+
+import (
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIHelp(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ t.Run("default help message", func(t *testing.T) {
+ helpMsg := GetOutputString(Kamel("help"))
+ Expect(helpMsg).To(ContainSubstring("Apache Camel K is a lightweight integration platform, born on Kubernetes"))
+ Expect(helpMsg).To(ContainSubstring("Usage:"))
+ Expect(helpMsg).To(ContainSubstring("Available Commands:"))
+ Expect(helpMsg).To(ContainSubstring("Flags:"))
+ })
+
+ t.Run("'get' command help (short flag)", func(t *testing.T) {
+ helpMsg := GetOutputString(Kamel("get", "-h"))
+ Expect(helpMsg).To(ContainSubstring("Get the status of integrations deployed on Kubernetes"))
+ Expect(helpMsg).To(ContainSubstring("Usage:"))
+ Expect(helpMsg).To(ContainSubstring("Flags:"))
+ })
+
+ t.Run("'bind' command help (long flag)", func(t *testing.T) {
+ helpMsg := GetOutputString(Kamel("bind", "--help"))
+ Expect(helpMsg).To(ContainSubstring("Bind Kubernetes resources, such as Kamelets, in an integration flow."))
+ Expect(helpMsg).To(ContainSubstring("kamel bind [source] [sink] ... [flags]"))
+ Expect(helpMsg).To(ContainSubstring("Global Flags:"))
+ })
+ })
+}
[camel-k] 03/04: Kamel CLI dump test was added
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit c9f0dd385d09cd56df9f16466a7181451e80ab76
Author: Vladislav Sokolovskii <vs...@redhat.com>
AuthorDate: Mon Jun 28 21:50:08 2021 +0300
Kamel CLI dump test was added
---
e2e/common/cli/dump_test.go | 58 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/e2e/common/cli/dump_test.go b/e2e/common/cli/dump_test.go
new file mode 100644
index 0000000..16534e8
--- /dev/null
+++ b/e2e/common/cli/dump_test.go
@@ -0,0 +1,58 @@
+// +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 common
+
+import (
+ v1 "k8s.io/api/core/v1"
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIDump(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ t.Run("dump empty namespace", func(t *testing.T) {
+ dump := GetOutputString(Kamel("dump", "-n", ns))
+
+ Expect(dump).To(ContainSubstring("Found 0 integrations:"))
+ Expect(dump).To(ContainSubstring("Found 0 deployments:"))
+ })
+
+ t.Run("dump non-empty namespace", func(t *testing.T) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationLogs(ns, "yaml")).Should(ContainSubstring("Magicstring!"))
+
+ dump := GetOutputString(Kamel("dump", "-n", ns))
+
+ Expect(dump).To(ContainSubstring("Found 1 platforms"))
+ Expect(dump).To(ContainSubstring("Found 1 integrations"))
+ Expect(dump).To(ContainSubstring("name: yaml"))
+ Expect(dump).To(ContainSubstring("Magicstring!"))
+
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+ })
+}
[camel-k] 02/04: Kamel CLI version test was added
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 58a1c00698c52cebfec4b931f268cdd45e43cb0a
Author: Vladislav Sokolovskii <vs...@redhat.com>
AuthorDate: Mon Jun 28 13:49:16 2021 +0300
Kamel CLI version test was added
---
e2e/common/cli/version_test.go | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/e2e/common/cli/version_test.go b/e2e/common/cli/version_test.go
new file mode 100644
index 0000000..7b3f05c
--- /dev/null
+++ b/e2e/common/cli/version_test.go
@@ -0,0 +1,40 @@
+// +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 common
+
+import (
+ "github.com/apache/camel-k/pkg/util/defaults"
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIVersion(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ t.Run("check version correctness", func(t *testing.T) {
+ version := GetOutputString(Kamel("version"))
+ Expect(version).To(ContainSubstring(defaults.Version))
+ })
+ })
+}
[camel-k] 04/04: Kamel CLI describe test was added
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 0aa37b401e0d326356da7edd42be57f9979ac02a
Author: mmajerni <mm...@localhost.localdomain>
AuthorDate: Fri Mar 26 10:57:49 2021 +0100
Kamel CLI describe test was added
---
e2e/common/cli/describe_test.go | 80 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/e2e/common/cli/describe_test.go b/e2e/common/cli/describe_test.go
new file mode 100644
index 0000000..dfd43c6
--- /dev/null
+++ b/e2e/common/cli/describe_test.go
@@ -0,0 +1,80 @@
+// +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 common
+
+import (
+ "regexp"
+ "testing"
+
+ . "github.com/apache/camel-k/e2e/support"
+ "github.com/apache/camel-k/pkg/util/defaults"
+ . "github.com/onsi/gomega"
+ v1 "k8s.io/api/core/v1"
+)
+
+func TestKamelCliDescribe(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+
+ t.Run("Test kamel describe integration", func(t *testing.T) {
+ integration := GetOutputString(Kamel("describe", "integration", "yaml", "-n", ns))
+ r, _ := regexp.Compile("(?sm).*Name:\\s+yaml.*")
+ Expect(integration).To(MatchRegexp(r.String()))
+
+ r, _ = regexp.Compile("(?sm).*Phase:\\s+Running.*")
+ Expect(integration).To(MatchRegexp(r.String()))
+
+ Expect(integration).To(ContainSubstring("Dependencies:"))
+ Expect(integration).To(ContainSubstring("Conditions:"))
+ })
+
+ t.Run("Test kamel describe integration kit", func(t *testing.T) {
+ kitName := Integration(ns, "yaml")().Status.IntegrationKit.Name
+ kit := GetOutputString(Kamel("describe", "kit", kitName, "-n", ns))
+
+ r, _ := regexp.Compile("(?sm).*Namespace:\\s+" + ns + ".*")
+ Expect(kit).To(MatchRegexp(r.String()))
+
+ r, _ = regexp.Compile("(?sm).*Runtime Version:\\s+" + defaults.DefaultRuntimeVersion + ".*")
+ Expect(kit).To(MatchRegexp(r.String()))
+
+ Expect(kit).To(ContainSubstring("camel-quarkus-core"))
+
+ Expect(kit).To(ContainSubstring("Artifacts:"))
+ Expect(kit).To(ContainSubstring("Dependencies:"))
+ })
+
+ t.Run("Test kamel describe integration platform", func(t *testing.T) {
+ platform := GetOutputString(Kamel("describe", "platform", "camel-k", "-n", ns))
+ r, _ := regexp.Compile("(?sm).*Name:\\s+camel-k.*")
+ Expect(platform).To(MatchRegexp(r.String()))
+
+ r, _ = regexp.Compile("(?sm).*Namespace:\\s+" + ns + ".*")
+ Expect(platform).To(MatchRegexp(r.String()))
+
+ r, _ = regexp.Compile("(?sm).*Runtime Version:\\s+" + defaults.DefaultRuntimeVersion + ".*")
+ Expect(platform).To(MatchRegexp(r.String()))
+ })
+ })
+}