internal/initwd: fix issues with tests and symlinks
filepath.EvalSymlinks is our friend! The code already does this, the tests needed to be updated to do the same.
This commit is contained in:
parent
d7ed4b0605
commit
69b6791ef1
|
@ -19,7 +19,11 @@ func TestDirFromModule_registry(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtureDir := filepath.Clean("testdata/empty")
|
fixtureDir := filepath.Clean("testdata/empty")
|
||||||
dir, done := tempChdir(t, fixtureDir)
|
tmpDir, done := tempChdir(t, fixtureDir)
|
||||||
|
dir, err := filepath.EvalSymlinks(tmpDir)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
modsDir := filepath.Join(dir, ".terraform/modules")
|
modsDir := filepath.Join(dir, ".terraform/modules")
|
||||||
defer done()
|
defer done()
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,12 @@ func TestLoaderInstallModules_registry(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtureDir := filepath.Clean("testdata/registry-modules")
|
fixtureDir := filepath.Clean("testdata/registry-modules")
|
||||||
dir, done := tempChdir(t, fixtureDir)
|
tmpDir, done := tempChdir(t, fixtureDir)
|
||||||
|
dir, err := filepath.EvalSymlinks(tmpDir)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
defer done()
|
defer done()
|
||||||
|
|
||||||
hooks := &testInstallHooks{}
|
hooks := &testInstallHooks{}
|
||||||
|
@ -359,7 +364,11 @@ func TestLoaderInstallModules_goGetter(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtureDir := filepath.Clean("testdata/go-getter-modules")
|
fixtureDir := filepath.Clean("testdata/go-getter-modules")
|
||||||
dir, done := tempChdir(t, fixtureDir)
|
tmpDir, done := tempChdir(t, fixtureDir)
|
||||||
|
dir, err := filepath.EvalSymlinks(tmpDir)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
defer done()
|
defer done()
|
||||||
|
|
||||||
hooks := &testInstallHooks{}
|
hooks := &testInstallHooks{}
|
||||||
|
|
Loading…
Reference in New Issue