Skip to content

Commit

Permalink
ci: add integration test to ensure that no opt default flags work wit…
Browse files Browse the repository at this point in the history
…hout a value passed
  • Loading branch information
MarlonGamez committed Apr 7, 2022
1 parent a38b554 commit 757d76c
Showing 1 changed file with 31 additions and 0 deletions.
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 757d76c

Please sign in to comment.