Re: [PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-03-12 Thread via GitHub


claudio4j commented on PR #5175:
URL: https://github.com/apache/camel-k/pull/5175#issuecomment-1991602878

   The change to use camel k plugin looks good.
   One suggestion, to show some camel-jbang version when dumping e2e error, it 
would be good to know the jbang and camel version in the dump 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.

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

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



Re: [PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-03-06 Thread via GitHub


gansheer commented on PR #5175:
URL: https://github.com/apache/camel-k/pull/5175#issuecomment-1981647514

   @squakez @oscerd @christophd @claudio4j  Could the tests be triggered please 
:pray: 


-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-02-22 Thread via GitHub


gansheer commented on code in PR #5175:
URL: https://github.com/apache/camel-k/pull/5175#discussion_r1498950178


##
.github/actions/setup-camel-jbang/install-jbang.sh:
##
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# ---
+# 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.
+# ---
+
+
+#
+# Outputs the kind config to output variables
+#
+
+
+set -e
+
+curl -Ls https://sh.jbang.dev | bash -s - app setup

Review Comment:
   That was a leftover from early work



-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-02-21 Thread via GitHub


claudio4j commented on code in PR #5175:
URL: https://github.com/apache/camel-k/pull/5175#discussion_r1498250558


##
e2e/support/test_support.go:
##
@@ -454,6 +486,72 @@ func KamelWithContext(ctx context.Context, args ...string) 
*cobra.Command {
return c
 }
 
+func CamelKWithContext(ctx context.Context, args ...string) *cobra.Command {
+   var c *cobra.Command
+   var err error
+
+   if os.Getenv("CAMEL_K_TEST_LOG_LEVEL") == "debug" {
+   fmt.Printf("Executing camel k with command %+q\n", args)
+   fmt.Println("Printing stack for KamelWithContext")
+   debug.PrintStack()
+   }
+
+   camelKArgs := os.Getenv("CAMELK_ARGS")
+   camelKDefaultArgs := strings.Fields(camelKArgs)
+   args = append(camelKDefaultArgs, args...)
+
+   camelKBin := os.Getenv("CAMELK_BIN")
+   if camelKBin != "" {
+   if _, e := os.Stat(camelKBin); e != nil && os.IsNotExist(e) {
+   failTest(e)
+   }
+   fmt.Printf("Using external camel k binary on path %s\n", 
camelKBin)
+   c = {
+   DisableFlagParsing: true,
+   RunE: func(cmd *cobra.Command, args []string) error {
+   externalBin := exec.CommandContext(ctx, 
camelKBin, args...)
+   var stdout, stderr io.Reader
+   stdout, err = externalBin.StdoutPipe()
+   if err != nil {
+   failTest(err)
+   }
+   stderr, err = externalBin.StderrPipe()
+   if err != nil {
+   failTest(err)
+   }
+   err := externalBin.Start()
+   if err != nil {
+   return err
+   }
+   _, err = io.Copy(c.OutOrStdout(), stdout)
+   if err != nil {
+   return err
+   }
+   _, err = io.Copy(c.ErrOrStderr(), stderr)
+   if err != nil {
+   return err
+   }
+   err = externalBin.Wait()
+   if err != nil {
+   return err
+   }
+   return nil
+   },
+   }
+   } else {
+   // Use modeline CLI as it's closer to the real usage
+   c, args, err = cmd.NewKamelWithModelineCommand(ctx, 
append([]string{"camel", "k"}, args...))

Review Comment:
   I suggest to use the environment variable `JBANG_NO_VERSION_CHECK=true` to 
avoid jbang to check update.



##
.github/actions/setup-camel-jbang/install-jbang.sh:
##
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# ---
+# 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.
+# ---
+
+
+#
+# Outputs the kind config to output variables
+#
+
+
+set -e
+
+curl -Ls https://sh.jbang.dev | bash -s - app setup

Review Comment:
   There is already the download and version check of jbang in 
[.github/actions/setup-camel-jbang/action.yaml](https://github.com/apache/camel-k/pull/5175/files#diff-2639ed9afedc2eb0c736a28edaca7e3aedea1088381a145987d7098de1c82224R38),
 maybe this install-jbang.sh is used elsewhere ?



-- 
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-unsubscr...@camel.apache.org

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



Re: [PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-02-21 Thread via GitHub


github-actions[bot] commented on PR #5175:
URL: https://github.com/apache/camel-k/pull/5175#issuecomment-1957397577

   :warning: Unit test coverage report - coverage decreased from 35.8% to 35.7% 
(**-0.1%**)


-- 
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-unsubscr...@camel.apache.org

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



[PR] [Experiment] Use Jbang camel k plugin in e2e test [camel-k]

2024-02-21 Thread via GitHub


gansheer opened a new pull request, #5175:
URL: https://github.com/apache/camel-k/pull/5175

   
   
   
   
   
   
   
   **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-unsubscr...@camel.apache.org

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