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.
This commit is contained in:
James Bardin 2020-10-12 14:38:43 -04:00
parent 5eca0788c6
commit 241765f0ab
1 changed files with 9 additions and 1 deletions

View File

@ -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))