Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt committed Jul 3, 2022
1 parent 72fdd58 commit e7f0bb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions pkg/runtime/local_executor_darwin_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package runtime

import (
"github.com/stretchr/testify/assert"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestRuntime_WithInheritFromShell(t *testing.T) {
Expand All @@ -18,7 +19,8 @@ func TestRuntime_WithInheritFromShell(t *testing.T) {
}

e := LocalExecutor{}
got := e.Execute(test)
got, err := e.Execute(test)
assert.NoError(t, err)

assert.Equal(t, "test", got.TestCase.Result.Stdout)
}
Expand All @@ -40,7 +42,8 @@ func TestRuntime_WithInheritFromShell_Overwrite(t *testing.T) {
}

e := LocalExecutor{}
got := e.Execute(test)
got, err := e.Execute(test)
assert.NoError(t, err)

assert.Equal(t, "overwrite from-parent", got.TestCase.Result.Stdout)
}
12 changes: 8 additions & 4 deletions pkg/runtime/local_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package runtime

import (
"fmt"
"github.com/stretchr/testify/assert"
"runtime"
"testing"

"github.com/stretchr/testify/assert"
)

func TestRuntime_WithEnvVariables(t *testing.T) {
Expand All @@ -29,7 +30,8 @@ func TestRuntime_WithEnvVariables(t *testing.T) {
}

e := LocalExecutor{}
got := e.Execute(s)
got, err := e.Execute(s)
assert.NoError(t, err)
assert.True(t, got.ValidationResult.Success)
}

Expand All @@ -42,7 +44,8 @@ func Test_runTestShouldReturnError(t *testing.T) {
}

e := LocalExecutor{}
got := e.Execute(test)
got, err := e.Execute(test)
assert.NoError(t, err)

if runtime.GOOS == "windows" {
assert.Contains(t, got.TestCase.Result.Error.Error(), "chdir /home/invalid")
Expand All @@ -60,7 +63,8 @@ func TestRuntime_WithInvalidDuration(t *testing.T) {
}

e := LocalExecutor{}
got := e.Execute(test)
got, err := e.Execute(test)
assert.NoError(t, err)

assert.Equal(t, `time: unknown unit "lightyears" in duration "600lightyears"`, got.TestCase.Result.Error.Error())
}

0 comments on commit e7f0bb8

Please sign in to comment.