-
Notifications
You must be signed in to change notification settings - Fork 599
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
Gateway resources consolidation #2602
Conversation
f71b031
to
bedd261
Compare
While you're in here refactoring tests @mlavacca, I wanted to mention that in recent weeks KTF has gotten a new cluster cleanup utility: There are some examples of its use in the GWO:
Not saying this is required as part of this work you're doing so don't consider it a blocker by any stretch of the imagination, but since you're already in here doing some test cleanup if you would like to clean up some of the myriad |
b70b334
to
ce3a7da
Compare
Would it be too much to ask for If I'd suggest to put a summary of what were the goals of this refactoring? e.g. what were the functions/methods/structs/interfaces added/removed? 🙏 Given |
@pmalek I updated the PR description to summarize the changes. |
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.
Minor nits but 🎖️ overall
ce3a7da
to
e692a8b
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.
🚢
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.
Looking good, I really do appreciate the emphasis on cleaning up some of our test code, and I particularly like that we're switching over to the KTF cluster.Cleaner
for cleanup because that saves a lot of space (don't forget to resolve #2618 if this does indeed update that for all cases).
I do have a few comments to share, take a look and let me know your thoughts.
Dismissing my own review to make sure it doesn't block the PR in my absence.
I used that cleaner only in the files touched by this refactoring. There are many other tests that still use the old cleaning approach. |
aee4da5
to
516e7c8
Compare
@pmalek If you don't pass the variable For what concern retrying a prior all the |
I somehow got fixated on the logging part of it and dismissed (in my head) Shane's concerns. So, I do agree with what was brought up (w.r.t. passing (Perhaps there's a better way to approach this but) I'd suggest to do pass the If need be we can create an issue and revisit passing the |
OMG, instead of commenting I edited your comment @mlavacca 😠 sorry for that. Should be reverted already now. |
2934626
to
ef4223c
Compare
@pmalek I followed this approach: the |
All the gateway and gatewayClass object explicit creations scattered around the test integration files have been cleaned up and factorized. A set of helper functions have been created to fulfill this need and to allow further usage when other new tests will be added. Signed-off-by: Mattia Lavacca <[email protected]>
ef4223c
to
fd20232
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 nit and I think this is good to get merged
Ideally, I'd like Shane to resolve his reservations |
Ok, let's wait for Shane's feedback. I have put the |
What this PR does / why we need it:
This PR aims at consolidating and factorizing the
gatewayClass
andGateway
resources across all the integration tests, to remove duplicated code and improve code quality.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #2461Special notes for your reviewer:
You can find the PR's change list below:
GatewayClass
andGateway
objects, followed by the respectiveGatewayV1alpha2().GatewayClasses().Create()
andGatewayV1alpha2().Gateway().Create()
function calls have been replaced by a helper call. These helpers are in thehelpers_test.go
file.gatewayClass
, created it at the beginning and deleted it at the end of the test (via a deferred function). Since about 90% of these objects were copypasta from one test function to another, a unique shared GatewayClass is now created at environment setup time; this object creation is in thesuite_test.go
file. Each neededGatewayClass
different from the default one is created through the aforementioned helper.tlsroute_test.go
,tcproute_test.go
,httproute_test.go
, andudproute_test.go
used specific helpers to check the linking or unlinking of the routes from the Gateway. They were copypasta one from another. They have been deleted and factorized in a unique function with two additional parameters:protocolType
: to specify the protocol to checkensureLinked
: to specify whether to check the linking or the unlinkingPR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR