From 1b67a06e3a98db6e41bcf9ad20e5ddb059f77c19 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Fri, 19 Apr 2019 15:37:27 -0700 Subject: [PATCH] Fix the display in the table tests. (#393) Currently we're collecting and printing extra objects as VerbActions, which of course is not what's extra, the extra is the object wrapped around them. So print that insted. --- reconciler/testing/table.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reconciler/testing/table.go b/reconciler/testing/table.go index dcd24c660..0a0a3a9bf 100644 --- a/reconciler/testing/table.go +++ b/reconciler/testing/table.go @@ -147,7 +147,7 @@ func (r *TableRow) Test(t *testing.T, factory Factory) { } if got, want := len(actions.Creates), len(r.WantCreates); got > want { for _, extra := range actions.Creates[want:] { - t.Errorf("Extra create: %#v", extra) + t.Errorf("Extra create: %#v", extra.GetObject()) } } @@ -181,7 +181,7 @@ func (r *TableRow) Test(t *testing.T, factory Factory) { } if got, want := len(updates), len(r.WantUpdates); got > want { for _, extra := range updates[want:] { - t.Errorf("Extra update: %#v", extra) + t.Errorf("Extra update: %#v", extra.GetObject()) } } @@ -225,11 +225,11 @@ func (r *TableRow) Test(t *testing.T, factory Factory) { } if len(statusUpdates)+len(updates) != len(actions.Updates) { - var unexpected []clientgotesting.UpdateAction + var unexpected []runtime.Object for _, update := range actions.Updates { if update.GetSubresource() != "status" && update.GetSubresource() != "" { - unexpected = append(unexpected, update) + unexpected = append(unexpected, update.GetObject()) } } @@ -251,7 +251,7 @@ func (r *TableRow) Test(t *testing.T, factory Factory) { } if got, want := len(actions.Deletes), len(r.WantDeletes); got > want { for _, extra := range actions.Deletes[want:] { - t.Errorf("Extra delete: %#v", extra) + t.Errorf("Extra delete: %s/%s", extra.GetNamespace(), extra.GetName()) } }