diff --git a/go.mod b/go.mod index fac164f896..02045576a4 100644 --- a/go.mod +++ b/go.mod @@ -28,9 +28,9 @@ require ( github.com/hashicorp/hcl/v2 v2.3.0 github.com/hashicorp/logutils v1.0.0 github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 - github.com/hashicorp/terraform-exec v0.9.0 + github.com/hashicorp/terraform-exec v0.10.0 github.com/hashicorp/terraform-json v0.5.0 - github.com/hashicorp/terraform-plugin-test/v2 v2.1.1 + github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba diff --git a/go.sum b/go.sum index ad71f3196f..9396f47519 100644 --- a/go.sum +++ b/go.sum @@ -203,12 +203,12 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-exec v0.9.0 h1:NmCtcsnmPBU6P3cDeKD26bD72evsMhmuDLvuNRgrTHc= -github.com/hashicorp/terraform-exec v0.9.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= +github.com/hashicorp/terraform-exec v0.10.0 h1:3nh/1e3u9gYRUQGOKWp/8wPR7ABlL2F14sZMZBrp+dM= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f0wvREtyzs= github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= -github.com/hashicorp/terraform-plugin-test/v2 v2.1.1 h1:aATRyyPlEKkFYUweD2Hld9eep77qzJVu8wg0mgyUE50= -github.com/hashicorp/terraform-plugin-test/v2 v2.1.1/go.mod h1:HaW2G5cDTVyiEKt7PHC85YSM5BwvYl/rIko1g8Lg7qE= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 h1:p96IIn+XpvVjw7AtN8y9MKxn0x69S7wtbGf7JgDJoIk= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= diff --git a/helper/resource/testing_new.go b/helper/resource/testing_new.go index 6dcb240681..c2a6582255 100644 --- a/helper/resource/testing_new.go +++ b/helper/resource/testing_new.go @@ -62,7 +62,10 @@ func RunNewTest(t *testing.T, c TestCase, providers map[string]terraform.Resourc } if !stateIsEmpty(statePreDestroy) { - runPostTestDestroy(t, c, wd, c.ProviderFactories) + err := runPostTestDestroy(t, c, wd, c.ProviderFactories) + if err != nil { + t.Fatalf("Error running post-test destroy, there may be dangling resources: %s", err.Error()) + } } wd.Close() diff --git a/helper/resource/testing_new_config.go b/helper/resource/testing_new_config.go index ef4f5f70b3..7b0f7455eb 100644 --- a/helper/resource/testing_new_config.go +++ b/helper/resource/testing_new_config.go @@ -137,8 +137,6 @@ func testStepNewConfig(t *testing.T, c TestCase, wd *tftest.WorkingDir, step Tes return fmt.Errorf("Error retrieving formatted plan output: %s", err) } return fmt.Errorf("After applying this test step, the plan was not empty.\nstdout:\n\n%s", stdout) - } else if step.ExpectNonEmptyPlan && planIsEmpty(plan) { - return fmt.Errorf("Expected a non-empty plan, but got an empty plan!") } // do a refresh