azure-service-operator icon indicating copy to clipboard operation
azure-service-operator copied to clipboard

Improve testing of import azure-resource

Open theunrepentantgeek opened this issue 2 years ago • 4 comments

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.

theunrepentantgeek avatar Aug 29 '23 01:08 theunrepentantgeek

This is something we want to do still

matthchr avatar Feb 12 '24 23:02 matthchr

Somewhat related to #3399 in that possibly we can export this as a library and test it at the same time

matthchr avatar Feb 12 '24 23:02 matthchr

We still want to do this

matthchr avatar Mar 04 '24 23:03 matthchr