core: Improve fail output for TestContext2Apply_destroyComputed

More detailed diagnostics log makes it easier to see what's failing.
This commit is contained in:
Martin Atkins 2018-09-17 15:57:04 -07:00
parent 14524600b1
commit d574a86d41
1 changed files with 4 additions and 2 deletions

View File

@ -1228,13 +1228,15 @@ func TestContext2Apply_destroyComputed(t *testing.T) {
})
if p, diags := ctx.Plan(); diags.HasErrors() {
t.Fatalf("plan errors: %s", diags.Err())
logDiagnostics(t, diags)
t.Fatal("plan failed")
} else {
t.Logf("plan:\n\n%s", legacyDiffComparisonString(p.Changes))
}
if _, diags := ctx.Apply(); diags.HasErrors() {
t.Fatalf("apply errors: %s", diags.Err())
logDiagnostics(t, diags)
t.Fatal("apply failed")
}
}