-
Notifications
You must be signed in to change notification settings - Fork 169
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
Consolidate e2e logic #3392
Consolidate e2e logic #3392
Conversation
44d679c
to
2199362
Compare
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.
One thing that concerns me about this PR but nothing to do with how you've structured it. The structure seems fine to me.
Small potential nit: In some cases you seem to opt for go's named returns - I'm not sure if this is a pattern that we commonly do in the RP code - it would be good to use whatever is the common parlance.
I personally have found it to be confusing when reviewing code but others may differ :)
TBH I don't know why I used it and reflecting I don't like it either. Thanks for the steer and I'll revert it |
I think the Go 1.20 change will let you get rid of the explicit typing in the usage of this... |
Nice. I'll make a note to loop back on this. Thanks for the heads up |
test/e2e/helpers.go
Outdated
@@ -93,11 +90,40 @@ func CreateK8sObjectWithRetry[T kruntime.Object]( | |||
// and the parameters for it. It then makes the call with some retry logic. | |||
func DeleteK8sObjectWithRetry( | |||
ctx context.Context, deleteFunc K8sDeleteFunc, name string, options metav1.DeleteOptions, | |||
) { | |||
) (err error) { |
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.
I am probably missing something, but In which cases is this function used in the cleanup? Isn't the cleanup using directly the Delete method from the clients.
Sometimes we just need to delete something: https://github.com/azure/ARO-RP/blob/77fa007891c18eeee0f217b74ff47e0e7c730a54/test/e2e/operator.go#L191 I suppose we could switch all called to DeleteK8sObjectWithRetry to CleanUp but that seems unnecessary/bad. What do you think? |
/azp run e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
lgtm
/azp run ci |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
LGTM. Great job mate
/azp run e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
Which issue this PR addresses:
This PR is just a little refactor really but doubles as an example of how we can compose the generics into more distinct blocks. This might seem like overkill (an argument I'm open to despite what I'm about to say) but IMO this is a perfect example of what we can do with generics. The alternative to this function would be 5-6 near identical functions i.e. CleanUp{Pods/Services/Namespace...}.
Let me know what you think
Test plan for issue:
The E2E tests
Is there any documentation that needs to be updated for this PR?
No