-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Fuzz pvc.Spec.Selector in API tests #27052
Conversation
@@ -357,6 +357,11 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source) | |||
}, | |||
func(pvc *api.PersistentVolumeClaim, c fuzz.Continue) { | |||
c.FuzzNoCustom(pvc) // fuzz self without calling this function again | |||
pvc.Spec.Selector = &unversioned.LabelSelector{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to write a custom fuzzer for unversioned.LabelSelector?
I can't tell if this is adding coverage or removing coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lavalamp there's already a TODO for it elsewhere in the file -- I would do it in a follow up if you wanted but it seemed like quite a bit of work -- this at least tests that the selelector goes through the conversion appropraitely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be as easy as adding a function like this? Then you'll test it everywhere it appears.
...,
func(uls *unversioned.LabelSelector, c fuzz.Continue) {
uls.MatchLabels = map[string]string{
"testlabelkey": "testlabelval",
}
},
...
Are you sure it's not tested now? I'm pretty sure that the fuzzer recurses into map types.
ping ... |
GCE e2e build/test passed for commit d34c1e6. |
I don't think this PR is needed, actually. After looking in the fuzzer, I think this removes instead of adds coverage. Closing. In a follow up, we should remove the logic for another test that does similar manual fuzzing for |
Fuzz PersistentVolumeClaim.Spec.Selector
Follow-up to #25917