azure-service-operator
azure-service-operator copied to clipboard
Improve testing of import azure-resource
Describe the current behavior
The code to import an Azure resource currently lacks in testing. We should fix that.
On #3212, #matthchr wrote:
Lacking a test related to this problem. I see that (like the core logic of the controller) it's somewhat difficult to unit test this code as it stands today. In the controller though we do have the recording tests to fall back on. Wondering here if we should define an interface that allows us to mock certain errors from Azure for aid in testing these cases? We actually already have one in
extensions.ImporterFunc... possibly we could leverage that with some test helpers to make it ergonomic to mock certain error responses from Azure and ensure we handle them?
Describe the improvement
Adding unit tests will insulate us against future maintenance issues.
This is something we want to do still
Somewhat related to #3399 in that possibly we can export this as a library and test it at the same time
We still want to do this