fixup some test comparisons

This commit is contained in:
James Bardin 2019-10-23 22:32:44 -04:00
parent 16b368e292
commit 886af20f07
2 changed files with 8 additions and 5 deletions

View File

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

View File

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