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 2022/03/22 09:38:26 UTC

[GitHub] [camel-k] bouskaJ opened a new pull request #3131: [TEST] Add kamel debug test

bouskaJ opened a new pull request #3131:
URL: https://github.com/apache/camel-k/pull/3131


   <!-- Description -->
   
   [TEST] Add `kamel debug` test
   
   
   <!--
   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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on a change in pull request #3131: [TEST] Add kamel debug test

Posted by GitBox <gi...@apache.org>.
squakez commented on a change in pull request #3131:
URL: https://github.com/apache/camel-k/pull/3131#discussion_r832048572



##########
File path: e2e/common/cli/debug_test.go
##########
@@ -0,0 +1,99 @@
+//go:build integration
+// +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/e2e/support"
+	. "github.com/onsi/gomega"
+	v1 "k8s.io/api/core/v1"
+	"net"
+	"testing"
+	"time"
+)
+
+func TestKamelCLIDebug(t *testing.T) {
+	WithNewTestNamespace(t, func(ns string) {
+		Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+		t.Run("debug local default port check", func(t *testing.T) {
+			Expect(Kamel("run", "-n", ns, "files/yaml.yaml").Execute()).To(Succeed())
+			Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+			Expect(portIsInUse("127.0.0.1", "5005")()).To(BeFalse())
+
+			go Kamel("debug", "yaml", "-n", ns).Execute()

Review comment:
       I wonder if the goroutine way is the best approach. I think that `kamel debug` execution will be hanging indefinitely.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] bouskaJ commented on a change in pull request #3131: [TEST] Add kamel debug test

Posted by GitBox <gi...@apache.org>.
bouskaJ commented on a change in pull request #3131:
URL: https://github.com/apache/camel-k/pull/3131#discussion_r836107911



##########
File path: e2e/common/cli/debug_test.go
##########
@@ -0,0 +1,99 @@
+//go:build integration
+// +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/e2e/support"
+	. "github.com/onsi/gomega"
+	v1 "k8s.io/api/core/v1"
+	"net"
+	"testing"
+	"time"
+)
+
+func TestKamelCLIDebug(t *testing.T) {
+	WithNewTestNamespace(t, func(ns string) {
+		Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
+
+		t.Run("debug local default port check", func(t *testing.T) {
+			Expect(Kamel("run", "-n", ns, "files/yaml.yaml").Execute()).To(Succeed())
+			Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
+			Expect(portIsInUse("127.0.0.1", "5005")()).To(BeFalse())
+
+			go Kamel("debug", "yaml", "-n", ns).Execute()

Review comment:
       @squakez good point. It should be fixed with 
   ```
   			debugTestContext, cancel := context.WithCancel(TestContext)
   			defer cancel()
   			go KamelWithContext(debugTestContext, "debug", "yaml", "-n", ns).Execute()
   ```




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org