fix issue on windows with using testingDir as input

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/4934/head
Matthew Fisher 7 years ago
parent df85810fdc
commit 73ea2ac518
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -46,12 +46,6 @@ var testingDir string
func testTimestamper() time.Time { return time.Unix(242085845, 0).UTC() } func testTimestamper() time.Time { return time.Unix(242085845, 0).UTC() }
func init() { func init() {
var err error
testingDir, err = ioutil.TempDir(testingDir, "helm")
if err != nil {
panic(err)
}
action.Timestamper = testTimestamper action.Timestamper = testTimestamper
} }
@ -64,10 +58,11 @@ func TestMain(m *testing.M) {
func testTempDir(t *testing.T) string { func testTempDir(t *testing.T) string {
t.Helper() t.Helper()
d, err := ioutil.TempDir(testingDir, "helm") d, err := ioutil.TempDir("", "helm")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
testingDir = d
return d return d
} }

@ -28,10 +28,10 @@ func TestHelmHome(t *testing.T) {
} }
isEq(t, hh.String(), "r:\\users\\helmtest") isEq(t, hh.String(), "r:\\users\\helmtest")
isEq(t, hh.Repository(), "r:\\users\\helmtestrepository") isEq(t, hh.Repository(), "r:\\users\\helmtest\\repository")
isEq(t, hh.RepositoryFile(), "r:\\users\\helmtestrepository\\repositories.yaml") isEq(t, hh.RepositoryFile(), "r:\\users\\helmtest\\repository\\repositories.yaml")
isEq(t, hh.Cache(), "r:\\users\\helmtestrepository\\cache") isEq(t, hh.Cache(), "r:\\users\\helmtest\\repository\\cache")
isEq(t, hh.CacheIndex("t"), "r:\\users\\helmtestrepository\\cache\\t-index.yaml") isEq(t, hh.CacheIndex("t"), "r:\\users\\helmtest\\repository\\cache\\t-index.yaml")
isEq(t, hh.Starters(), "r:\\users\\helmteststarters") isEq(t, hh.Starters(), "r:\\users\\helmtest\\starters")
isEq(t, hh.Archive(), "r:\\users\\helmtestcache\\archive") isEq(t, hh.Archive(), "r:\\users\\helmtest\\cache\\archive")
} }

Loading…
Cancel
Save