Skip to content

Commit

Permalink
fix: add default value for status-check flag when no value is specifi…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarlonGamez authored and bskaplan committed Apr 26, 2022
1 parent c58a08a commit 5385a5e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/skaffold/app/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ var flagRegistry = []Flag{
FlagAddMethod: "Var",
DefinedOn: []string{"dev", "debug", "deploy", "run", "apply"},
IsEnum: true,
NoOptDefVal: "true",
},
{
Name: "iterative-status-check",
Expand Down
31 changes: 31 additions & 0 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,34 @@ func TestRunTest(t *testing.T) {
})
}
}

// TestRunNoOptFlags tests to ensure that flags that don't require a value to be passed work when no value is passed
func TestRunNoOptFlags(t *testing.T) {
test := struct {
description string
dir string
targetLog string
pods []string
args []string
}{
description: "getting-started",
dir: "testdata/getting-started",
pods: []string{"getting-started"},
targetLog: "Hello world!",
args: []string{
"--port-forward",
"--status-check",
},
}

MarkIntegrationTest(t, CanRunWithoutGcp)
t.Run(test.description, func(t *testing.T) {
ns, _ := SetupNamespace(t)

args := append(test.args, "--tail")
out := skaffold.Run(args...).InDir(test.dir).InNs(ns.Name).RunLive(t)
defer skaffold.Delete().InDir(test.dir).InNs(ns.Name).RunOrFail(t)

WaitForLogs(t, out, test.targetLog)
})
}

0 comments on commit 5385a5e

Please sign in to comment.