-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable envtest-based unit tests for webhooks #5721
Comments
Note: #5719 depends on this issue |
@fabriziopandini WDYT? |
Just realized that the idea might sound good in theory, but that we have way too many api packages. So we still would have to call 6 setup funcs whenever we use |
PR #5722 represents a potential solution by refactoring the envtest package. I've discussed the issue with Fabrizio and we would simply implement the webhooks integration test in a package like The problem with the changes proposed in the PR is that they would distribute the webhook setup all over the place vs. currently webhooks will just work out of the box when using envtest. |
We're now implementing the first integration tests in I'm not sure if we should keep this issue around for further discussions or close it for now. |
I think we close this discussion for now - if it comes up again we can open a new issue, but for the webhook case we have something that works for now. |
/close |
@sbueringer: Closing this issue. In response to this:
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. |
User Story
As a developer I would like to be able to write unit tests with envtest for our webhooks.
Note: In case of webhooks the fakeclient unit tests have (at least) the following limitations:
Detailed Description
I would suggest implementing it the same way we currently add indices to our testenv:
SetupWebhooks
func toRunInput
(used ininternal/envtest.Run
)This solution would enable envtest-based unit test for all our webhook packages except top-level
api/v1beta1
, because this would lead to a circular dependency betweenapi/v1beta
andwebhooks
. But we already have this limitation today and if we want to unit test one of the webhooks in theapi/v1beta1
package with envtest we can simply move it to thewebhooks
package./kind feature
The text was updated successfully, but these errors were encountered: