You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/03/15 13:20:39 UTC
[GitHub] [camel-k] vsokolov00 opened a new pull request #2126: e2e kamel cli delete test
vsokolov00 opened a new pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126
<!-- Description -->
<!--
Enter your extended release note in the below block. If the PR requires
additional action from users switching to the new release, include the string
"action required". If no release note is required, write "NONE".
You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
the text is added to the right section of the release notes.
-->
**Release Note**
```release-note
NONE
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 commented on pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-800675842
> Could you please rebase, and make sure to remove the extra merge commit "Merge branch 'e2e-test-cli'"?
Done :) the history is clear now
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli delete test
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r594339870
##########
File path: e2e/common/cli/delete_test.go
##########
@@ -0,0 +1,79 @@
+// +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 cli
+
+import (
+ v1 "k8s.io/api/core/v1"
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIDelete(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("delete running integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete building integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete integration from csv", func(t *testing.T) {
+ Expect(Kamel("run", "https://github.com/apache/camel-k/blob/master/e2e/common/files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete several integrations", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "../files/Java.java", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ Expect(Kamel("delete", "java", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("java"))
Review comment:
@vsokolov00 Maybe you should rather verify that the integration resource and the pod were actually removed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 edited a comment on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 edited a comment on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-852181554
@oscerd tests on k8 were successful, made some changes to adjust the test suit to the openshift, but **failure of builder-it (Buildah) was not affected by my changes**. Could you run the pipe one more time please, hopefully the last one 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r595751402
##########
File path: e2e/common/cli/get_test.go
##########
@@ -0,0 +1,60 @@
+// +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 TestKamelCLIGet(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("get integration", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+ str := GetOutputString(Kamel("get", "-n", ns))
+ Expect(str).Should(ContainSubstring("yaml\tRunning\tkit-"))
Review comment:
You can check the whole kit name. `Integration("yaml",ns).Status.Kit`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] astefanutti commented on a change in pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r595777930
##########
File path: e2e/common/cli/get_test.go
##########
@@ -0,0 +1,60 @@
+// +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 TestKamelCLIGet(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("get integration", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+ str := GetOutputString(Kamel("get", "-n", ns))
+ Expect(str).Should(ContainSubstring("yaml\tRunning\tkit-"))
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+
+ t.Run("get several integrations", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "../files/Java.java", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(GetOutputString(Kamel("get", "-n", ns))).Should(ContainSubstring("yaml\tRunning\tkit-"))
+ Expect(GetOutputString(Kamel("get", "-n", ns))).Should(ContainSubstring("java\tRunning\tkit-"))
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+
+ t.Run("get no integrations" , func(t *testing.T) {
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("Running"))
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("Building Kit"))
Review comment:
nit: `ShouldNot` -> `NotTo`
##########
File path: e2e/common/cli/get_test.go
##########
@@ -0,0 +1,60 @@
+// +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 TestKamelCLIGet(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("get integration", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+ str := GetOutputString(Kamel("get", "-n", ns))
+ Expect(str).Should(ContainSubstring("yaml\tRunning\tkit-"))
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+
+ t.Run("get several integrations", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "../files/Java.java", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(GetOutputString(Kamel("get", "-n", ns))).Should(ContainSubstring("yaml\tRunning\tkit-"))
+ Expect(GetOutputString(Kamel("get", "-n", ns))).Should(ContainSubstring("java\tRunning\tkit-"))
Review comment:
nit: `Should` -> `To`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 commented on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-852181554
tests on k8 were successful, made some changes to adjust the test suit to the openshift, but **failure of builder-it (Buildah) was not affected by my changes**. Could you run the pipe one more time please, hopefully the last one 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 commented on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-852055712
@oscerd Could you run the tests again please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 edited a comment on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 edited a comment on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-852181554
@oscerd tests on k8 were successful, made some changes to adjust the test suit to the openshift, but **failure of builder-it (Buildah) was not affected by my changes, seems that there were some problems with github/dockerhub packages or sth**. Could you run the pipe one more time please, hopefully the last one 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] astefanutti commented on pull request #2126: e2e kamel cli delete test
Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-800076388
Could you please rebase, and make sure to remove the extra merge commit "Merge branch 'e2e-test-cli'"?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] astefanutti closed pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
astefanutti closed pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r595751402
##########
File path: e2e/common/cli/get_test.go
##########
@@ -0,0 +1,60 @@
+// +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 TestKamelCLIGet(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("get integration", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+ str := GetOutputString(Kamel("get", "-n", ns))
+ Expect(str).Should(ContainSubstring("yaml\tRunning\tkit-"))
Review comment:
You can check the whole kit name. `Integration("yaml",ns)().Status.Kit`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli delete test
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r594898267
##########
File path: e2e/common/cli/delete_test.go
##########
@@ -38,20 +38,20 @@ func TestKamelCLIDelete(t *testing.T) {
Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
- Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ Eventually(Integration("yaml", ns)).Should(BeNil())
Review comment:
@vsokolov00 can you verify that the IntegrationPod was removed as well?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli delete test
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r594339870
##########
File path: e2e/common/cli/delete_test.go
##########
@@ -0,0 +1,79 @@
+// +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 cli
+
+import (
+ v1 "k8s.io/api/core/v1"
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIDelete(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("delete running integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete building integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete integration from csv", func(t *testing.T) {
+ Expect(Kamel("run", "https://github.com/apache/camel-k/blob/master/e2e/common/files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete several integrations", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "../files/Java.java", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ Expect(Kamel("delete", "java", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("java"))
Review comment:
@vsokolov00 Since focus of this test is `kamel delete` you should verify that the integration resource and the pod were actually removed rather than `kamel get` command output.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 commented on a change in pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r595605892
##########
File path: e2e/common/cli/delete_test.go
##########
@@ -38,20 +38,20 @@ func TestKamelCLIDelete(t *testing.T) {
Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
- Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ Eventually(Integration("yaml", ns)).Should(BeNil())
Review comment:
done, please check if everything is ok in the latest commits
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] vsokolov00 edited a comment on pull request #2126: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
vsokolov00 edited a comment on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-800675842
> Could you please rebase, and make sure to remove the extra merge commit "Merge branch 'e2e-test-cli'"?
Done :) the history is clean now
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] astefanutti commented on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-861278600
The root cause of the issue with running the `debug` command in a separate routine may lie in the usage of Viper _static_ methods, that relies on a static instance:
```
fatal error: concurrent map iteration and map write
goroutine 2563 [running]:
runtime.throw(0x2517dd2, 0x26)
/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/panic.go:1116 +0x72 fp=0xc0006f1398 sp=0xc0006f1368 pc=0x439972
runtime.mapiternext(0xc001068720)
/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/map.go:853 +0x554 fp=0xc0006f1418 sp=0xc0006f1398 pc=0x412ab4
reflect.mapiternext(0xc001068720)
/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/map.go:1337 +0x2b fp=0xc0006f1430 sp=0xc0006f1418 pc=0x46bc0b
reflect.(*MapIter).Next(0xc0002143c0, 0x2213580)
/opt/hostedtoolcache/go/1.15.13/x64/src/reflect/value.go:1277 +0xd6 fp=0xc0006f1458 sp=0xc0006f1430 pc=0x4deb36
internal/fmtsort.Sort(0x216a200, 0xc0007d7410, 0x15, 0x28d13c0)
/opt/hostedtoolcache/go/1.15.13/x64/src/internal/fmtsort/sort.go:63 +0x1ac fp=0xc0006f1508 sp=0xc0006f1458 pc=0x4f1a4c
fmt.(*pp).printValue(0xc0009c60d0, 0x216a200, 0xc0007d7410, 0x15, 0x7fb900000076, 0x0)
/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:773 +0xca5 fp=0xc0006f16e0 sp=0xc0006f1508 pc=0x4fb1c5
fmt.(*pp).printArg(0xc0009c60d0, 0x216a200, 0xc0007d7410, 0x76)
/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:716 +0x2b4 fp=0xc0006f1778 sp=0xc0006f16e0 pc=0x4f9e74
fmt.(*pp).doPrintf(0xc0009c60d0, 0x254d701, 0x37, 0xc0006f1918, 0x2, 0x2)
/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/print.go:1030 +0x168 fp=0xc0006f1860 sp=0xc0006f1778 pc=0x4fd468
fmt.Errorf(0x254d701, 0x37, 0xc0006f1918, 0x2, 0x2, 0x30, 0x30)
/opt/hostedtoolcache/go/1.15.13/x64/src/fmt/errors.go:20 +0x77 fp=0xc0006f18c8 sp=0xc0006f1860 pc=0x4f33b7
github.com/spf13/cast.ToStringMapE(0x216a200, 0xc0007d7410, 0x1e87015, 0x2f0000c00076b320, 0xc0007d7380)
/home/runner/go/pkg/mod/github.com/spf13/cast@v1.3.0/caste.go:989 +0x217 fp=0xc0006f19a8 sp=0xc0006f18c8 pc=0x1e29b77
github.com/spf13/cast.ToStringMap(...)
/home/runner/go/pkg/mod/github.com/spf13/cast@v1.3.0/cast.go:139
github.com/spf13/viper.(*Viper).isPathShadowedInFlatMap(0xc00076b320, 0xc0009c99b0, 0x3, 0x3, 0x216a200, 0xc0007d7410, 0x0, 0x3)
/home/runner/go/pkg/mod/github.com/spf13/viper@v1.7.0/viper.go:663 +0x73 fp=0xc0006f1a10 sp=0xc0006f19a8 pc=0x1e87173
github.com/spf13/viper.(*Viper).find(0xc00076b320, 0xc00021adb0, 0x24, 0x1, 0x41617b, 0xc0006f1bd0)
/home/runner/go/pkg/mod/github.com/spf13/viper@v1.7.0/viper.go:1092 +0xe6e fp=0xc0006f1b30 sp=0xc0006f1a10 pc=0x1e8a12e
github.com/spf13/viper.(*Viper).Get(0xc00076b320, 0xc00021adb0, 0x24, 0xf, 0xc000af9528)
/home/runner/go/pkg/mod/github.com/spf13/viper@v1.7.0/viper.go:728 +0x85 fp=0xc0006f1bc0 sp=0xc0006f1b30 pc=0x1e87465
github.com/spf13/viper.(*Viper).AllSettings(0xc00076b320, 0xc00168a248)
/home/runner/go/pkg/mod/github.com/spf13/viper@v1.7.0/viper.go:1923 +0xbc fp=0xc0006f1c80 sp=0xc0006f1bc0 pc=0x1e9191c
github.com/spf13/viper.AllSettings(...)
/home/runner/go/pkg/mod/github.com/spf13/viper@v1.7.0/viper.go:1918
github.com/apache/camel-k/pkg/cmd.decodeKey(0x22d5ec0, 0xc0009f40e0, 0xc0008a1355, 0xb, 0x1, 0x3)
/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:120 +0xb8 fp=0xc0006f1d98 sp=0xc0006f1c80 pc=0x1f1a458
github.com/apache/camel-k/pkg/cmd.decode.func1(0xc00092e000, 0xc000af23f0, 0x1, 0x3, 0x0, 0x0)
/home/runner/work/camel-k/camel-k/pkg/cmd/util.go:164 +0x71 fp=0xc0006f1de8 sp=0xc0006f1d98 pc=0x1f2e011
github.com/spf13/cobra.(*Command).execute(0xc00092e000, 0xc000af2390, 0x3, 0x3, 0xc00092e000, 0xc000af2390)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:839 +0x530 fp=0xc0006f1ec0 sp=0xc0006f1de8 pc=0x1374450
github.com/spf13/cobra.(*Command).ExecuteC(0xc000ffe000, 0x0, 0xc000e3afc0, 0xc00026f080)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375 fp=0xc0006f1f98 sp=0xc0006f1ec0 pc=0x1374f15
github.com/spf13/cobra.(*Command).Execute(0xc000ffe000, 0xc000ffe000, 0x0)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895 +0x2b fp=0xc0006f1fc8 sp=0xc0006f1f98 pc=0x1374b6b
runtime.goexit()
/opt/hostedtoolcache/go/1.15.13/x64/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc0006f1fd0 sp=0xc0006f1fc8 pc=0x472421
created by github.com/apache/camel-k/e2e/common/cli.TestKamelCLIDebug.func1.3
/home/runner/work/camel-k/camel-k/e2e/common/cli/debug_test.go:71 +0x3a7
```
A possible solution would be to create a separate Viper instance, for each command execution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] oscerd commented on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
oscerd commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-852080854
Restarted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] bouskaJ commented on a change in pull request #2126: e2e kamel cli delete test
Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#discussion_r594339870
##########
File path: e2e/common/cli/delete_test.go
##########
@@ -0,0 +1,79 @@
+// +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 cli
+
+import (
+ v1 "k8s.io/api/core/v1"
+ "testing"
+
+ . "github.com/onsi/gomega"
+
+ . "github.com/apache/camel-k/e2e/support"
+)
+
+func TestKamelCLIDelete(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+ t.Run("delete running integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete building integration", func(t *testing.T) {
+ Expect(Kamel("run", "-n", ns, "../files/yaml.yaml").Execute()).To(Succeed())
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete integration from csv", func(t *testing.T) {
+ Expect(Kamel("run", "https://github.com/apache/camel-k/blob/master/e2e/common/files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ })
+
+ t.Run("delete several integrations", func(t *testing.T) {
+ Expect(Kamel("run", "../files/yaml.yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(Kamel("run", "../files/Java.java", "-n", ns).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+ Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("yaml"))
+ Expect(Kamel("delete", "java", "-n", ns).Execute()).To(Succeed())
+ Expect(GetOutputString(Kamel("get", "-n", ns))).ShouldNot(ContainSubstring("java"))
Review comment:
@vsokolov00 Since focus of this test is `kamel delete` you should verify that the integration resource and the pod were actually removed rather than `kamel get` command.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] astefanutti commented on pull request #2126: test: e2e kamel cli tests
Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #2126:
URL: https://github.com/apache/camel-k/pull/2126#issuecomment-865700484
Superseded by #2422. Tests for the `kamel debug` command will be part of a new PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org