8 "github.com/hashicorp/go-getter"
11 // TestTree loads a module at the given path and returns the tree as well
12 // as a function that should be deferred to clean up resources.
13 func TestTree(t *testing.T, path string) (*Tree, func()) {
14 // Create a temporary directory for module storage
15 dir, err := ioutil.TempDir("", "tf")
17 t.Fatalf("err: %s", err)
22 mod, err := NewTreeModule("", path)
24 t.Fatalf("err: %s", err)
28 // Get the child modules
29 s := &getter.FolderStorage{StorageDir: dir}
30 if err := mod.Load(s, GetModeGet); err != nil {
31 t.Fatalf("err: %s", err)