From 241765f0abff4206ea65860cca0f8aa917717bfc Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 12 Oct 2020 14:38:43 -0400 Subject: [PATCH] don't check outputs for legacy tests The legacy tests never had to account for outputs in the plan. This path is not used outside of old builtin test provider, so just work around the output changes until we remove this completely. --- helper/resource/testing_config.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/helper/resource/testing_config.go b/helper/resource/testing_config.go index 04194dddf..74739c8a0 100644 --- a/helper/resource/testing_config.go +++ b/helper/resource/testing_config.go @@ -115,9 +115,17 @@ func testStep(opts terraform.ContextOpts, state *terraform.State, step TestStep) if stepDiags.HasErrors() { return state, newOperationError("second follow-up plan", stepDiags) } - empty := p.Changes.Empty() + empty := true newState := p.State + // the legacy tests never took outputs into account + for _, c := range p.Changes.Resources { + if c.Action != plans.NoOp { + empty = false + break + } + } + if !empty { if step.ExpectNonEmptyPlan { log.Printf("[INFO] Got non-empty plan, as expected:\n\n%s", legacyPlanComparisonString(newState, p.Changes))