Skip to content

Commit

Permalink
IO redirections were not working on linux
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Tomlinson <jtomlinson@nvidia.com>
  • Loading branch information
jacobtomlinson committed Apr 5, 2022
1 parent 226e667 commit 7e1c72b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions cmd/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,16 @@
package cmd

import (
"bytes"
"testing"

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

func TestValidate(t *testing.T) {
assert := assert.New(t)

b := new(bytes.Buffer)
rootCmd.SetOut(b)
rootCmd.SetErr(b)
rootCmd.SetArgs([]string{"validate", "--file", "../examples/kubeflow.yaml", "container-canary/kubeflow:shouldpass"})
rootCmd.Execute()

assert.Contains(b.String(), "Validating container-canary/kubeflow:shouldpass against kubeflow", "did not validate")
err := rootCmd.Execute()
assert.Nil(err, "should not error")
}

func TestFileDoesNotExist(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func Validate(image string, configPath string, cmd *cobra.Command, debug bool) (
debug: debug,
image: image,
}
p := tea.NewProgram(m, tea.WithInput(cmd.InOrStdin()), tea.WithOutput(cmd.OutOrStdout()))
p := tea.NewProgram(m)
out, err := p.StartReturningModel()
if err != nil {
return false, err
Expand Down

0 comments on commit 7e1c72b

Please sign in to comment.