diff --git a/command/refresh_test.go b/command/refresh_test.go index 68c1fb748..acbb68c4a 100644 --- a/command/refresh_test.go +++ b/command/refresh_test.go @@ -27,6 +27,8 @@ import ( "github.com/hashicorp/terraform/terraform" ) +var equateEmpty = cmpopts.EquateEmpty() + func TestRefresh(t *testing.T) { state := testState() statePath := testStateFile(t, state) @@ -626,8 +628,10 @@ func TestRefresh_disableBackup(t *testing.T) { } newState := testStateRead(t, statePath) - if !reflect.DeepEqual(newState, state) { - t.Fatalf("bad: %#v", newState) + if !cmp.Equal(state, newState, equateEmpty) { + spew.Config.DisableMethods = true + fmt.Println(cmp.Diff(state, newState, equateEmpty)) + t.Fatalf("bad: %s", newState) } newState = testStateRead(t, outPath) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 317369bcf..5df64f381 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -2980,9 +2980,8 @@ func TestContext2Apply_orphanResource(t *testing.T) { s.SetResourceMeta(zeroAddr, states.EachList, providerAddr) s.SetResourceMeta(oneAddr, states.EachList, providerAddr) s.SetResourceInstanceCurrent(oneAddr.Instance(addrs.IntKey(0)), &states.ResourceInstanceObjectSrc{ - Status: states.ObjectReady, - AttrsJSON: []byte(`{}`), - Dependencies: []addrs.AbsResource{}, + Status: states.ObjectReady, + AttrsJSON: []byte(`{}`), }, providerAddr) }) if !cmp.Equal(state, want) {