kubeflow/katib

Refactor `/pkg/webhook/v1beta1/pod/inject_webhook_test.go` according to Developer Guide.

Closed this issue · 2 comments

What you would like to be added?

Refactor /pkg/webhook/v1beta1/pod/inject_webhook_test.go to obey rules defined in the Developer Guide.

Why is this needed?

Currently, testcases in /pkg/webhook/v1beta1/pod/inject_webhook_test.go are defined in slices and use reflect.Equal for comparison. It's not recommended according to the Developer Guide. We should:

  1. Use cmp.Diff instead of reflect.Equal, to provide useful comparisons.

  2. Define test cases as maps instead of slices to avoid dependencies on the running order. Map key should be equal to the test case name.

Love this feature?

Give it a 👍 We prioritize the features with most 👍

Thank you for creating this @Electronic-Waste!

Do you want to work on this testing improvement ?

@andreyvelich Yes, I will work on this testing improvement when I have the bandwidth.

/assign