Skip to content

Commit

Permalink
churn: fix exec test under go 1.17+ (argoproj#275)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Rodrigues <[email protected]>
  • Loading branch information
Artur Rodrigues authored Dec 21, 2022
1 parent d365d6f commit fa80524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.15
go-version: 1.19

- name: Build
run: |
Expand Down
6 changes: 2 additions & 4 deletions exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ func TestRunCommandExitErr(t *testing.T) {
}

func TestRunCommandErr(t *testing.T) {
//_ := test.NewGlobal()
log.SetLevel(log.DebugLevel)
defer log.SetLevel(log.InfoLevel)

// this would create a panic
output, err := RunCommand("", CmdOpts{Redactor: Redact([]string{"world"})})
output, err := RunCommand("sh", CmdOpts{Redactor: Redact([]string{"world"})}, "-c", ">&2 echo 'failure'; false")
assert.Empty(t, output)
assert.EqualError(t, err, "fork/exec : no such file or directory")
assert.EqualError(t, err, "`sh -c >&2 echo 'failure'; false` failed exit status 1: failure")
}

func TestRunInDir(t *testing.T) {
Expand Down

0 comments on commit fa80524

Please sign in to comment.