From eeccfdd143aebeb28bc720692798cdc42a268b4f Mon Sep 17 00:00:00 2001 From: Colin Hoglund Date: Tue, 16 Aug 2022 11:42:02 -0700 Subject: [PATCH] fix test --- internal/run/upgrade_test.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/internal/run/upgrade_test.go b/internal/run/upgrade_test.go index e7240a5..3313eec 100644 --- a/internal/run/upgrade_test.go +++ b/internal/run/upgrade_test.go @@ -2,11 +2,12 @@ package run import ( "fmt" + "strings" + "testing" + "github.com/golang/mock/gomock" "github.com/pelotech/drone-helm3/internal/env" "github.com/stretchr/testify/suite" - "strings" - "testing" ) type UpgradeTestSuite struct { @@ -228,16 +229,16 @@ func (suite *UpgradeTestSuite) TestPrepareDebugFlag() { func (suite *UpgradeTestSuite) TestPrepareSkipCrdsFlag() { defer suite.ctrl.Finish() - cfg := env.Config{ - Chart: "at40", - Release: "cabbages_smell_great", - SkipCrds: true, - } - u := NewUpgrade(cfg) + cfg := env.NewTestConfig(suite.T()) + cfg.Chart = "at40" + cfg.Release = "cabbages_smell_great" + cfg.SkipCrds = true + + u := NewUpgrade(*cfg) command = func(path string, args ...string) cmd { suite.Equal(helmBin, path) - suite.Equal([]string{"upgrade", "--install", "--skip-crds", "cabbages_smell_great", "at40"}, args) + suite.Equal([]string{"upgrade", "--install", "--skip-crds", "--history-max=10", "cabbages_smell_great", "at40"}, args) return suite.mockCmd }