Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of rubbish logs from serialization_test #19133

Merged
merged 1 commit into from
Dec 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions pkg/api/serialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ func fuzzInternalObject(t *testing.T, forVersion unversioned.GroupVersion, item
func roundTrip(t *testing.T, codec runtime.Codec, item runtime.Object) {
printer := spew.ConfigState{DisableMethods: true}

gvk, err := api.Scheme.ObjectKind(item)
t.Logf("fully qualified kind for %v is %v with codec %v", reflect.TypeOf(item), gvk, codec)

name := reflect.TypeOf(item).Elem().Name()
data, err := runtime.Encode(codec, item)
if err != nil {
Expand Down Expand Up @@ -122,8 +119,8 @@ func roundTripSame(t *testing.T, item runtime.Object, except ...string) {

// For debugging problems
func TestSpecificKind(t *testing.T) {
api.Scheme.Log(t)
defer api.Scheme.Log(nil)
// api.Scheme.Log(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining why you leave this code commented instead of removing it. Same below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it the same way it was already commented in one of the tests below: TestRoundTripTypes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, OK.

// defer api.Scheme.Log(nil)

kind := "Pod"
for i := 0; i < *fuzzIters; i++ {
Expand All @@ -135,8 +132,8 @@ func TestSpecificKind(t *testing.T) {
}

func TestList(t *testing.T) {
api.Scheme.Log(t)
defer api.Scheme.Log(nil)
// api.Scheme.Log(t)
// defer api.Scheme.Log(nil)

kind := "List"
item, err := api.Scheme.New(api.SchemeGroupVersion.WithKind(kind))
Expand Down