Skip to content

Commit

Permalink
REVISIT/TODO: fix-test: semantic equality for pkg/deploy roundtrip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Apr 19, 2017
1 parent 3439803 commit 766b1de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/deploy/api/v1/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ func TestDefaults(t *testing.T) {
t.Errorf("unexpected object: %v", got)
t.FailNow()
}
if !reflect.DeepEqual(got.Spec, expected.Spec) {
// TODO(rebase): check that there are no fields which have different semantics for nil and []
if !kapi.Semantic.DeepEqual(got.Spec, expected.Spec) {
t.Errorf("got different than expected:\nA:\t%#v\nB:\t%#v\n\nDiff:\n%s\n\n%s", got, expected, diff.ObjectDiff(expected, got), diff.ObjectGoPrintSideBySide(expected, got))
}
}
Expand Down

2 comments on commit 766b1de

@sttts
Copy link
Owner Author

@sttts sttts commented on 766b1de Apr 19, 2017

Choose a reason for hiding this comment

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

@Kargakis: this is related to kubernetes/kubernetes#43203 / kubernetes/kubernetes#43422 in the 1.6 rebase (compare openshift#13419). Can you check which fields need a distinction between nil and empty slice/map? We have to register equality funcs for them in kapi.Semantic.

@0xmichalis
Copy link

Choose a reason for hiding this comment

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

For DeploymentConfigs, dc.spec.triggers was using that distinction but I think it's already handled, see openshift#13419 (comment)

Please sign in to comment.