mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-17 23:57:52 +00:00
replace spew methods with dump methods
Kubernetes-commit: c4e1b01416ec05e6a520a181d4ce3b4333adb4e4
This commit is contained in:
committed by
Kubernetes Publisher
parent
4e89310f6e
commit
ef522cc423
@@ -24,7 +24,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -32,6 +31,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
fakeclientset "k8s.io/client-go/kubernetes/fake"
|
||||
testcore "k8s.io/client-go/testing"
|
||||
@@ -260,7 +260,7 @@ func TestNewInformerWatcher(t *testing.T) {
|
||||
sort.Sort(byEventTypeAndName(result))
|
||||
|
||||
if !reflect.DeepEqual(expected, result) {
|
||||
t.Error(spew.Errorf("\nexpected: %#v,\ngot: %#v,\ndiff: %s", expected, result, cmp.Diff(expected, result)))
|
||||
t.Errorf("\nexpected: %s,\ngot: %s,\ndiff: %s", dump.Pretty(expected), dump.Pretty(result), cmp.Diff(expected, result))
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -26,13 +26,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/dump"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
@@ -530,7 +530,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
for i := 0; i < len(tc.expected); i++ {
|
||||
event, ok := <-watcher.ResultChan()
|
||||
if !ok {
|
||||
t.Error(spew.Errorf("expected event %#+v, but channel is closed"), tc.expected[i])
|
||||
t.Errorf("expected event %s, but channel is closed", dump.Pretty(tc.expected[i]))
|
||||
break
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
select {
|
||||
case event, ok := <-watcher.ResultChan():
|
||||
if ok {
|
||||
t.Error(spew.Errorf("Unexpected event received after reading all the expected ones: %#+v", event))
|
||||
t.Errorf("Unexpected event received after reading all the expected ones: %s", dump.Pretty(event))
|
||||
}
|
||||
case <-time.After(10 * time.Millisecond):
|
||||
break
|
||||
@@ -564,7 +564,7 @@ func TestRetryWatcher(t *testing.T) {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.expected, got) {
|
||||
t.Fatal(spew.Errorf("expected %#+v, got %#+v;\ndiff: %s", tc.expected, got, cmp.Diff(tc.expected, got)))
|
||||
t.Fatalf("expected %s, got %s;\ndiff: %s", dump.Pretty(tc.expected), dump.Pretty(got), cmp.Diff(tc.expected, got))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user