Skip to content

Commit

Permalink
some feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ludvig Liljenberg <lliljenberg@microsoft.com>
  • Loading branch information
ludfjig committed Aug 7, 2023
1 parent b309a26 commit 335c113
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions pkg/exec/builder/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package builder

import (
"context"
"fmt"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -145,9 +144,9 @@ func TestExecuteStep_HasOrderedArguments(t *testing.T) {
}

func TestExecuteStep_SpecifiesCustomWorkingDirectory(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip() // pwd not available on windows (for some reason the only command that works is "help" ?!?)
}
//if runtime.GOOS == "windows" {
// t.Skip() // pwd not available on windows (for some reason the only command that works is "help" ?!?)
//}

ctx := context.Background()
c := porterruntime.NewTestRuntimeConfig(t)
Expand All @@ -163,8 +162,13 @@ func TestExecuteStep_SpecifiesCustomWorkingDirectory(t *testing.T) {
SuffixArguments: []string{},
}

if runtime.GOOS == "windows" {
step.TestStep.Command = "cmd.exe"
step.Arguments = []string{"/c", "cd"}
}

_, err := ExecuteStep(ctx, c.RuntimeConfig, step)
assert.Equal(t, fmt.Sprintln(wd), c.TestContext.GetOutput())
assert.Equal(t, wd, strings.TrimRight(c.TestContext.GetOutput(), "\r\n"))
require.NoError(t, err, "Execute Step failed")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/test/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestMainWithMockedCommandHandlers(m *testing.M) {

// There may be multiple expected commands, separated by a newline character
wantCmds := strings.Split(expectedCmdEnv, "\n")

commandNotFound := true
for _, wantCmd := range wantCmds {
if wantCmd == gotCmd {
Expand Down

0 comments on commit 335c113

Please sign in to comment.