You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/11/11 04:17:04 UTC
[camel-k] branch main updated: chore: Fix tests on macOS aarch64
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 7ea64d23e chore: Fix tests on macOS aarch64
7ea64d23e is described below
commit 7ea64d23e7c144ec1f1148e94010282f7508a868
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Wed Nov 9 22:36:28 2022 +0100
chore: Fix tests on macOS aarch64
---
pkg/util/command_test.go | 11 +++++------
pkg/util/maven/maven_log_test.go | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/pkg/util/command_test.go b/pkg/util/command_test.go
index 8ac7f4f6b..98187b097 100644
--- a/pkg/util/command_test.go
+++ b/pkg/util/command_test.go
@@ -45,17 +45,16 @@ var (
)
func TestRunAndLog(t *testing.T) {
- cmd := exec.CommandContext(context.Background(), "/usr/bin/date")
+ cmd := exec.CommandContext(context.Background(), "date")
err := RunAndLog(context.Background(), cmd, loggerInfo, loggerError)
assert.Nil(t, err)
}
-// Let's comment this because the Error logging might be different on different Linux distribution
-/*func TestRunAndLogInvalid(t *testing.T) {
- cmd := exec.CommandContext(context.Background(), "/usr/bin/date", "-dsa")
+func TestRunAndLogInvalid(t *testing.T) {
+ cmd := exec.CommandContext(context.Background(), "date", "-dsa")
err := RunAndLog(context.Background(), cmd, loggerInfo, loggerError)
assert.NotNil(t, err)
- assert.Equal(t, "/usr/bin/date: invalid date ‘sa’: exit status 1", err.Error())
-}*/
+ assert.ErrorContains(t, err, "exit status 1")
+}
diff --git a/pkg/util/maven/maven_log_test.go b/pkg/util/maven/maven_log_test.go
index 86f27c0f3..96c1441d4 100644
--- a/pkg/util/maven/maven_log_test.go
+++ b/pkg/util/maven/maven_log_test.go
@@ -27,7 +27,7 @@ import (
)
func TestRunAndLogErrorMvn(t *testing.T) {
- cmd := exec.CommandContext(context.Background(), "/usr/bin/mvn", "package")
+ cmd := exec.CommandContext(context.Background(), "mvn", "package")
err := util.RunAndLog(context.Background(), cmd, mavenLogHandler, mavenLogHandler)
assert.NotNil(t, err)