Merge pull request #3508 from adshmh/fix-set-app-version-unit-test-implicit-dependency

fix the implicit dependency of TestSetAppVersion test on previous tests
pull/3449/merge
Matthew Fisher 7 years ago committed by GitHub
commit e13eba128f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -205,7 +205,19 @@ func TestSetAppVersion(t *testing.T) {
var ch *chart.Chart var ch *chart.Chart
expectedAppVersion := "app-version-foo" expectedAppVersion := "app-version-foo"
tmp, _ := ioutil.TempDir("", "helm-package-app-version-") tmp, _ := ioutil.TempDir("", "helm-package-app-version-")
defer os.RemoveAll(tmp)
thome, err := tempHelmHome(t)
if err != nil {
t.Fatal(err)
}
cleanup := resetEnv()
defer func() {
os.RemoveAll(tmp)
os.RemoveAll(thome.String())
cleanup()
}()
settings.Home = helmpath.Home(thome)
c := newPackageCmd(&bytes.Buffer{}) c := newPackageCmd(&bytes.Buffer{})
flags := map[string]string{ flags := map[string]string{
@ -213,7 +225,7 @@ func TestSetAppVersion(t *testing.T) {
"app-version": expectedAppVersion, "app-version": expectedAppVersion,
} }
setFlags(c, flags) setFlags(c, flags)
err := c.RunE(c, []string{"testdata/testcharts/alpine"}) err = c.RunE(c, []string{"testdata/testcharts/alpine"})
if err != nil { if err != nil {
t.Errorf("unexpected error %q", err) t.Errorf("unexpected error %q", err)
} }

Loading…
Cancel
Save