From 82297588067a8ae3720bd4a2f15eea2dc066e559 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 10 Jul 2014 13:21:34 -0700 Subject: [PATCH] helper/resource: refresh during test --- helper/resource/testing.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helper/resource/testing.go b/helper/resource/testing.go index fb8ebf9a5..92b755852 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -190,6 +190,13 @@ func testStep( ws, es) } + // Refresh! + state, err = ctx.Refresh() + if err != nil { + return state, fmt.Errorf( + "Error refreshing: %s", err) + } + // Plan! if _, err := ctx.Plan(&terraform.PlanOpts{Destroy: step.Destroy}); err != nil { return state, fmt.Errorf(