From a285c04dc9b636510a96bcfedf02041266aa6eef Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 20 Apr 2016 09:50:59 -0700 Subject: [PATCH] helper/resource: only verify id-only run if no error --- helper/resource/testing.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 5505da0ab8..f3f125ad15 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -149,11 +149,13 @@ func Test(t TestT, c TestCase) { // Go through each step and run it var idRefreshCheck *terraform.ResourceState + errored := false for i, step := range c.Steps { var err error log.Printf("[WARN] Test: Executing step %d", i) state, err = testStep(opts, state, step) if err != nil { + errored = true t.Error(fmt.Sprintf( "Step %d error: %s", i, err)) break @@ -194,7 +196,7 @@ func Test(t TestT, c TestCase) { } // If we never checked an id-only refresh, it is a failure - if idRefreshCheck == nil { + if !errored && idRefreshCheck == nil { t.Error("ID-only refresh check never ran.") }