Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a unit test for config_controller.go
Add a unit test for config_controller.go to test the case that when a new type is added to HNCConfiguration singleton, the corresponding object reconciler can be created correctly. This PR also does the following refactoring: - Moves shared helper functions from each controller test files to a common file: test_helpers_test.go - Switches the object type in object_controller_test.go from Secret to Role because: - The behaviors that are tested in the object_controller_test.go are irrelevant to the object type or the creation of a new object reconciler. - Since the test suite creates the object reconciler for Role by default, object_controller_test.go can use the existing Role object reconciler for the tests instead of creating a new object reconciler. - The tests inside controllers_test package share the same test environment, which means if the test in one Describe container adds a type to HNCConfiguration singleton, the corresponding object reconciler for that type will be created and will still be there when running subsequent Describe containers in the package. Until we find a way to "cleanup" object reconcilers, it is better to only create new object reconcilers when necessary. Design doc: http://bit.ly/hnc-type-configuration Issue: kubernetes-retired#411
- Loading branch information