Skip to content
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

Improve testing of import azure-resource #3214

Open
theunrepentantgeek opened this issue Aug 29, 2023 · 4 comments
Open

Improve testing of import azure-resource #3214

theunrepentantgeek opened this issue Aug 29, 2023 · 4 comments
Assignees
Labels
test Test refactoring related tasks
Milestone

Comments

@theunrepentantgeek
Copy link
Member

theunrepentantgeek commented Aug 29, 2023

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.

@matthchr
Copy link
Member

This is something we want to do still

@matthchr matthchr added the test Test refactoring related tasks label Feb 12, 2024
@matthchr
Copy link
Member

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

@matthchr
Copy link
Member

matthchr commented Mar 4, 2024

We still want to do this

@theunrepentantgeek
Copy link
Member Author

We should also consider doing recorded tests, capturing the full interaction with ARM.

We'd likely have caught the issues leading to #3805 if we'd done this.

@theunrepentantgeek theunrepentantgeek added this to the v2.12.0 milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Test refactoring related tasks
Projects
Development

No branches or pull requests

2 participants