diff --git a/cmd/testdata/TestRootGoldenOutput/default.golden b/cmd/testdata/TestRootGoldenOutput/default.golden index e75950944..cf8cc6462 100644 --- a/cmd/testdata/TestRootGoldenOutput/default.golden +++ b/cmd/testdata/TestRootGoldenOutput/default.golden @@ -9,7 +9,9 @@ Available Commands: workflow Access to argo workflows Flags: - --debug enable verbose output - -h, --help help for airshipctl + --debug enable verbose output + -h, --help help for airshipctl + --kubeconfig string path to kubeconfig + --namespace string kubernetes namespace to use for the context of this command (default "default") Use "airshipctl [command] --help" for more information about a command. diff --git a/internal/test/utilities.go b/internal/test/utilities.go index ce2df0773..fd1899ff3 100644 --- a/internal/test/utilities.go +++ b/internal/test/utilities.go @@ -10,6 +10,8 @@ import ( "testing" "github.com/ian-howell/airshipctl/cmd" + "github.com/ian-howell/airshipctl/pkg/environment" + "k8s.io/client-go/kubernetes/fake" ) // UpdateGolden writes out the golden files with the latest values, rather than failing the test. @@ -42,9 +44,12 @@ func RunCmdTests(t *testing.T, tests []CmdTest) { func executeCmd(t *testing.T, command string) []byte { var actual bytes.Buffer + settings := &environment.AirshipCTLSettings{ + KubeClient: fake.NewSimpleClientset(), + } // TODO(howell): switch to shellwords (or similar) args := strings.Fields(command) - rootCmd, err := cmd.NewRootCmd(&actual, args) + rootCmd, err := cmd.NewRootCmd(&actual, settings, args) if err != nil { t.Fatalf(err.Error()) }