cleanup error handling and some for loops
This commit is contained in:
parent
96436f526a
commit
f521fcca97
|
@ -108,7 +108,7 @@ func TestPlanApplyInAutomation(t *testing.T) {
|
||||||
|
|
||||||
stateResources := state.RootModule().Resources
|
stateResources := state.RootModule().Resources
|
||||||
var gotResources []string
|
var gotResources []string
|
||||||
for n, _ := range stateResources {
|
for n := range stateResources {
|
||||||
gotResources = append(gotResources, n)
|
gotResources = append(gotResources, n)
|
||||||
}
|
}
|
||||||
sort.Strings(gotResources)
|
sort.Strings(gotResources)
|
||||||
|
|
|
@ -107,7 +107,7 @@ func TestPrimarySeparatePlan(t *testing.T) {
|
||||||
|
|
||||||
stateResources := state.RootModule().Resources
|
stateResources := state.RootModule().Resources
|
||||||
var gotResources []string
|
var gotResources []string
|
||||||
for n, _ := range stateResources {
|
for n := range stateResources {
|
||||||
gotResources = append(gotResources, n)
|
gotResources = append(gotResources, n)
|
||||||
}
|
}
|
||||||
sort.Strings(gotResources)
|
sort.Strings(gotResources)
|
||||||
|
|
|
@ -54,7 +54,7 @@ func TestTerraformProvidersMirror(t *testing.T) {
|
||||||
"registry.terraform.io/hashicorp/template/terraform-provider-template_2.1.1_windows_386.zip",
|
"registry.terraform.io/hashicorp/template/terraform-provider-template_2.1.1_windows_386.zip",
|
||||||
}
|
}
|
||||||
var got []string
|
var got []string
|
||||||
err = filepath.Walk(outputDir, func(path string, info os.FileInfo, err error) error {
|
walkErr := filepath.Walk(outputDir, func(path string, info os.FileInfo, err error) error {
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
return nil // we only care about leaf files for this test
|
return nil // we only care about leaf files for this test
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@ func TestTerraformProvidersMirror(t *testing.T) {
|
||||||
got = append(got, filepath.ToSlash(relPath))
|
got = append(got, filepath.ToSlash(relPath))
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if walkErr != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(walkErr)
|
||||||
}
|
}
|
||||||
sort.Strings(got)
|
sort.Strings(got)
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,9 @@ func TestUnmanagedSeparatePlan(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
tf.AddEnv("TF_REATTACH_PROVIDERS=" + string(reattachStr))
|
tf.AddEnv("TF_REATTACH_PROVIDERS=" + string(reattachStr))
|
||||||
tf.AddEnv("PLUGIN_PROTOCOL_VERSION=5")
|
tf.AddEnv("PLUGIN_PROTOCOL_VERSION=5")
|
||||||
|
|
Loading…
Reference in New Issue