-
Notifications
You must be signed in to change notification settings - Fork 600
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
add roundtrip tests #3574
add roundtrip tests #3574
Conversation
@dprotaso would you mind taking a looksie? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vaikas The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Looks good - you may want to also test round tripping between your hub version and your v1 types |
This pull request introduces 1 alert when merging 6e8afa1 into 54e191e - view on LGTM.com new alerts:
|
var FuzzerFuncs = fuzzer.MergeFuzzerFuncs( | ||
func(codecs serializer.CodecFactory) []interface{} { | ||
return []interface{}{ | ||
func(ds *DeliverySpec, c fuzz.Continue) { |
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.
This means it won’t fuzz the other fields of the delivery spec - you may want to fuzz it here (no custom) and just override the back off policy after
} | ||
|
||
// Test v1 -> v1beta1 -> v1 | ||
func TestDeliveryStatuscConversionV1(t *testing.T) { |
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.
Typo in func name
Also to confirm you wrote this test so that avoid side-effects failure on the input?
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.
No, that was covered by the RT tests. I added these because we really didn't have any tests, so wanted to increase coverage.
I think there are funcs names with other typos |
} | ||
}, | ||
func(imc *InMemoryChannel, c fuzz.Continue) { | ||
if imc != nil { |
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.
likewise - i this won't fuzz the other fields so you'll need FuzzNoCustom
on imc
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.
ack, also combined the status here so don't need both IMC + IMC.Status. Is that right? I think it is because it uncovered a bug :)
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.
also combined the status here so don't need both IMC + IMC.Status. Is that right?
FuzzNoCustom
won't call these supplied fuzzer functions so you'll have to fuzz it yourself. You could use c.Fuzz
for nested types if you did need to customize the fuzzing.
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.
Ack, so, is it now right?
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.
FuzzNoCustom won't call these supplied fuzzer functions so you'll have to fuzz it yourself. You could use c.Fuzz for nested types if you did need to customize the fuzzing.
I was wrong about this - by bad
var FuzzerFuncs = fuzzer.MergeFuzzerFuncs( | ||
func(codecs serializer.CodecFactory) []interface{} { | ||
return []interface{}{ | ||
func(ch *Channel, c fuzz.Continue) { |
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.
likewise - i this won't fuzz the other fields so you'll need FuzzNoCustom
on ch
Thanks @dprotaso !! I think I addressed all the comments, and found / fixed a bug :) |
The following is the coverage report on the affected files.
|
@vaikas: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
Add RoundTrip tests for eventing., messaging., and flows.* resources.
Proposed Changes
Release Note
Docs