Skip to content

Commit

Permalink
chore: Fix tests on macOS aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
  • Loading branch information
christophd authored and oscerd committed Nov 11, 2022
1 parent b20d0d9 commit c6e76ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/util/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +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)
}

func TestRunAndLogInvalid(t *testing.T) {
cmd := exec.CommandContext(context.Background(), "/usr/bin/date", "-dsa")
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")
}
2 changes: 1 addition & 1 deletion pkg/util/maven/maven_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c6e76ea

Please sign in to comment.