Commit da989dc2 authored by Arash Deshmeh's avatar Arash Deshmeh

fix(helm): fix the bug in test code 'cmd/helm/init_test.go' and 'cmd/helm/repo_update_test.go'

        that leave behind temporary helm home directories during build.
        With this fix, the build process no longer leaves behind 'helm_home-*' temp directories.
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>
parent 184f7840
...@@ -46,7 +46,7 @@ func TestInitCmd(t *testing.T) { ...@@ -46,7 +46,7 @@ func TestInitCmd(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(home) defer os.RemoveAll(home)
var buf bytes.Buffer var buf bytes.Buffer
fc := fake.NewSimpleClientset() fc := fake.NewSimpleClientset()
...@@ -80,7 +80,7 @@ func TestInitCmd_exists(t *testing.T) { ...@@ -80,7 +80,7 @@ func TestInitCmd_exists(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(home) defer os.RemoveAll(home)
var buf bytes.Buffer var buf bytes.Buffer
fc := fake.NewSimpleClientset(&v1beta1.Deployment{ fc := fake.NewSimpleClientset(&v1beta1.Deployment{
...@@ -113,7 +113,7 @@ func TestInitCmd_clientOnly(t *testing.T) { ...@@ -113,7 +113,7 @@ func TestInitCmd_clientOnly(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(home) defer os.RemoveAll(home)
var buf bytes.Buffer var buf bytes.Buffer
fc := fake.NewSimpleClientset() fc := fake.NewSimpleClientset()
...@@ -184,7 +184,7 @@ func TestEnsureHome(t *testing.T) { ...@@ -184,7 +184,7 @@ func TestEnsureHome(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(home) defer os.RemoveAll(home)
b := bytes.NewBuffer(nil) b := bytes.NewBuffer(nil)
hh := helmpath.Home(home) hh := helmpath.Home(home)
......
...@@ -37,7 +37,7 @@ func TestUpdateCmd(t *testing.T) { ...@@ -37,7 +37,7 @@ func TestUpdateCmd(t *testing.T) {
cleanup := resetEnv() cleanup := resetEnv()
defer func() { defer func() {
os.Remove(thome.String()) os.RemoveAll(thome.String())
cleanup() cleanup()
}() }()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment