-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Design Improvements Description
We need to create a shared way across kubebuilder/pkg/ unittests and e2e tests to reuse functionality of creating/using binaries and temporary directory. That way we re-use the same code across files and reduce the overhead of modifying multiple areas from the maintenance perspective. Thus, also improving readability and structure.
Existing helper for binary creation:
https://github.com/kubernetes-sigs/kubebuilder/blob/869ca6b65027baa71f4d5410f68f7830c1c90857/test/e2e/utils/test_context.go#L64C1-L117C2
Existing helper for cleaning up dir: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/e2e/utils/test_context.go#L251-L270
Example Usage: https://github.com/kubernetes-sigs/kubebuilder/blob/869ca6b65027baa71f4d5410f68f7830c1c90857/test/e2e/v4/e2e_suite_test.go#L40-L43
What do we need
- We need something like test/context.go in our repo where the helpers can be placed.
- kubebuilder/pkg/ unit tests to use the contexts.
- Identify similar adjustments and add it to test/ and make sure we re-use code as much as possible for testing.