u5surf commented on code in PR #3828:
URL: https://github.com/apache/camel-k/pull/3828#discussion_r1030979575


##########
pkg/util/command_test.go:
##########
@@ -56,5 +57,9 @@ func TestRunAndLogInvalid(t *testing.T) {
        err := RunAndLog(context.Background(), cmd, loggerInfo, loggerError)
 
        assert.NotNil(t, err)
-       assert.ErrorContains(t, err, "exit status 1")
+       if runtime.GOOS == "darwin" {
+               assert.ErrorContains(t, err, "exit status 1")

Review Comment:
   @squakez 
   > darwin (we should understand which is the output there)
   It failed in my macOS environment when I changed the test below.
   And it had not the difference between aarch64 and amd64.
   
   ```
   diff --git a/pkg/util/command_test.go b/pkg/util/command_test.go
   index 38c08c367..9b4498343 100644
   --- a/pkg/util/command_test.go
   +++ b/pkg/util/command_test.go
   @@ -58,7 +58,7 @@ func TestRunAndLogInvalid(t *testing.T) {
   
           assert.NotNil(t, err)
           if runtime.GOOS == "darwin" {
   -               assert.ErrorContains(t, err, "exit status 1")
   +               assert.ErrorContains(t, err, "date: illegal option -- d")
           } else {
                   assert.ErrorContains(t, err, "date: invalid date ‘sa’:")
           }
   ```
   test result
   ```
   --- FAIL: TestRunAndLogInvalid (0.03s)
       command_test.go:61:
                Error Trace:    
/Users/yugo-horie/camel-k/pkg/util/command_test.go:61
                Error:          Error ": exit status 1" does not contain "date: 
illegal option -- d"
                Test:           TestRunAndLogInvalid
   FAIL
   FAIL github.com/apache/camel-k/pkg/util      0.494s
   ```
   
   And moreover linux date error messages seems to be different by each 
environments because
   my ubuntu20.04 indicate the following message which doesn't including 
command full path. Thus
   I consider that the it doesn't need the assert which is including the full 
path of the command in error messages.
   



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

Reply via email to