Merge branch 'master' into helm-delete

This commit is contained in:
Erin Call
2019-12-19 11:34:44 -08:00
4 changed files with 257 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ func determineSteps(cfg Config) *func(Config) []Step {
case "delete":
return &del
case "lint":
panic("not implemented")
return &lint
case "help":
return &help
default:
@@ -119,6 +119,14 @@ var del = func(cfg Config) []Step {
return steps
}
var lint = func(cfg Config) []Step {
lint := &run.Lint{
Chart: cfg.Chart,
}
return []Step{lint}
}
var help = func(cfg Config) []Step {
help := &run.Help{}
return []Step{help}

View File

@@ -180,6 +180,20 @@ func (suite *PlanTestSuite) TestInitKube() {
suite.Equal(expected, init)
}
func (suite *PlanTestSuite) TestLint() {
cfg := Config{
Chart: "./flow",
}
steps := lint(cfg)
suite.Equal(1, len(steps))
want := &run.Lint{
Chart: "./flow",
}
suite.Equal(want, steps[0])
}
func (suite *PlanTestSuite) TestDeterminePlanUpgradeCommand() {
cfg := Config{
Command: "upgrade",
@@ -215,6 +229,15 @@ func (suite *PlanTestSuite) TestDeterminePlanDeleteFromDroneEvent() {
suite.Same(&del, stepsMaker)
}
func (suite *PlanTestSuite) TestDeterminePlanLintCommand() {
cfg := Config{
Command: "lint",
}
stepsMaker := determineSteps(cfg)
suite.Same(&lint, stepsMaker)
}
func (suite *PlanTestSuite) TestDeterminePlanHelpCommand() {
cfg := Config{
Command: "help",