Skip to content

Commit

Permalink
Add more test logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Dec 13, 2023
1 parent a02f414 commit 38a6a34
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/controllers/reconciliation/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,18 @@ func TestCRUD(t *testing.T) {
}

func (c *crudTestCase) WaitForPhase(t *testing.T, downstream client.Client, phase string) {
var lastRV string
testutil.Eventually(t, func() bool {
obj, err := c.Get(downstream)
return err == nil && getPhase(obj) == phase
currentPhase := getPhase(obj)
currentRV := obj.GetResourceVersion()
if lastRV == "" {
t.Logf("initial resource version %s was observed in phase %s", obj.GetResourceVersion(), currentPhase)
} else if currentRV != lastRV {
t.Logf("resource version transitioned from %s to %s in phase %s", obj.GetResourceVersion(), lastRV, currentPhase)
}
lastRV = currentRV
return err == nil && currentPhase == phase
})
}

Expand Down

0 comments on commit 38a6a34

Please sign in to comment.