initwd: cache registry responses for module versions and download URL (#23727)

* initwd: cache registry responses for module versions and download URL

Closes #23544
This commit is contained in:
Kristin Laemmert
2020-01-07 15:03:23 -05:00
committed by GitHub
parent 2a95d98383
commit 4045a6e5d0
2 changed files with 67 additions and 27 deletions

View File

@@ -327,6 +327,14 @@ func TestLoaderInstallModules_registry(t *testing.T) {
return
}
//check that the registry reponses were cached
if _, ok := inst.moduleVersions["hashicorp/module-installer-acctest/aws"]; !ok {
t.Fatal("module versions cache was not populated")
}
if _, ok := inst.moduleVersionsUrl[moduleVersion{module: "hashicorp/module-installer-acctest/aws", version: "0.0.1"}]; !ok {
t.Fatal("module download url cache was not populated")
}
loader, err := configload.NewLoader(&configload.Config{
ModulesDir: modulesDir,
})