-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Chore]: Backfill unit tests for repositories
package
#601
Comments
I would generally advice against mocking types we don't own, in this case the |
Thank you, @gcapizzi. I'll discuss this with the AMER team today. I agree that, if we add these, it only makes sense to test the |
@matt-royal someone also pointed out that some |
- This allows us to reach better code coverage for error cases - We added interfaces for the namespace retriever and nsperms objects in order to make them fakeable. - We added fakes for the client factory and client interfaces also. - Minor typo and format fixes. [#601] Co-authored-by: Julian Hjortshoj <hjortshojj@vmware.com>
[#601] Authored-by: Matt Royal <mroyal@vmware.com>
We created a POC to add unit level tests to the existing suite, but it didn't get a lot of support, so we abandoned it. @georgethebeatle has another approach to try by adding an interface layer on top of the k8s cliet, but for now we will close this issue. |
Background
We've been feeling the pain of our integration-only strategy lately, and have been unable to test some common failure cases. We've already established patterns for testing the controllers with k8s client fakes, and we're confident we can do the same here.
Action to take
Find the
// untested
comments in therepositories
package and backfill unit tests for those cases.Impact
This will give us more confidence that we're properly implementing error handling, and also help us avoid regressions of untested behavior
Dev Notes
The text was updated successfully, but these errors were encountered: