-
Notifications
You must be signed in to change notification settings - Fork 526
Refactor seed
integration test not to use gstruct
Matcher
#11616
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
Conversation
d8da11a
to
c00eea0
Compare
test/utils/matchers/matchers.go
Outdated
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
// ObjectNames takes an ObjectList and returns a list of the objects within this list. |
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.
// ObjectNames takes an ObjectList and returns a list of the objects within this list. | |
// ObjectNames takes an ObjectList and returns the corresponding names of the objects. |
test/utils/matchers/matchers.go
Outdated
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.
Move to github.com/gardener/gardener/pkg/utils/test/matchers
or github.com/gardener/gardener/pkg/utils/test
?
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.
besides the previous comments, lgtm
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.
Thanks 🙂
/lgtm
LGTM label has been added. Git tree hash: da114db5467f3ca1c3cdb7baf5f19e96f83cd13f
|
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
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LucaBernstein 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 |
How to categorize this PR?
/area testing
/kind cleanup
What this PR does / why we need it:
As mentioned in #11386 (comment), this change aligns the output to this change, improving test output in error cases.
Before, we just used the
gstruct
matcher in this case to see if names of Objects align. In an error case,ginkgo
prints out the entire struct (which are lists in this case), leading to truncated output.With this change, this test also just matches for the name, shortening the output and making it more readable
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I was not sure where to extract the
objectNames()
function to, for me this place felt the most fitting, because I could not find a better place intest/utils
. I am not satisfied with the name of the package, but could not find a better one.Release note: