diff --git a/test/upgrade/shell/executor.go b/test/upgrade/shell/executor.go index df5739586c..d41ccc765a 100644 --- a/test/upgrade/shell/executor.go +++ b/test/upgrade/shell/executor.go @@ -18,7 +18,6 @@ package shell import ( "bytes" - "errors" "fmt" "os" "os/exec" @@ -32,9 +31,6 @@ const ( executeMode = 0700 ) -// ErrNoProjectLocation is returned if user didnt provided the project location. -var ErrNoProjectLocation = errors.New("project location isn't provided") - // NewExecutor creates a new executor. func NewExecutor(t TestingT, loc ProjectLocation, opts ...Option) Executor { config := &ExecutorConfig{ @@ -61,10 +57,6 @@ func testingTStreams(t TestingT) Streams { // RunScript executes a shell script with args. func (s *streamingExecutor) RunScript(script Script, args ...string) error { - err := validate(s.ExecutorConfig) - if err != nil { - return err - } cnt := script.scriptContent(s.ProjectLocation, args) return withTempScript(cnt, func(bin string) error { return stream(bin, s.ExecutorConfig, script.Label) @@ -73,10 +65,6 @@ func (s *streamingExecutor) RunScript(script Script, args ...string) error { // RunFunction executes a shell function with args. func (s *streamingExecutor) RunFunction(fn Function, args ...string) error { - err := validate(s.ExecutorConfig) - if err != nil { - return err - } cnt := fn.scriptContent(s.ProjectLocation, args) return withTempScript(cnt, func(bin string) error { return stream(bin, s.ExecutorConfig, fn.Label) @@ -87,13 +75,6 @@ type streamingExecutor struct { ExecutorConfig } -func validate(config ExecutorConfig) error { - if config.ProjectLocation == nil { - return ErrNoProjectLocation - } - return nil -} - func configureDefaultValues(config *ExecutorConfig) { if config.LabelOut == "" { config.LabelOut = defaultLabelOut diff --git a/test/upgrade/shell/executor_test.go b/test/upgrade/shell/executor_test.go index f9f8ef3a8f..b0332278b1 100644 --- a/test/upgrade/shell/executor_test.go +++ b/test/upgrade/shell/executor_test.go @@ -29,7 +29,6 @@ func TestNewExecutor(t *testing.T) { helloWorldTestCase(t), abortTestCase(t), failExampleCase(t), - missingProjectLocationCase(), } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -111,19 +110,6 @@ func failExampleCase(t *testing.T) testcase { } } -func missingProjectLocationCase() testcase { - return testcase{ - "missing project location", - shell.ExecutorConfig{}, - func(exec shell.Executor) error { - return exec.RunFunction(fn("id")) - }, - wants{ - failed: true, - }, - } -} - type wants struct { failed bool outs []string