-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add tests to ResourceGroup_Controller #287
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Happy to have additional and better assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go ahead and merge when the tests finish
@clmccart looks like the most recent failure is complaining about https://github.com/clmccart/azure-service-operator/blob/patch/rg_controller_tests/controllers/resourcegroup_controller_test.go#L40 which referts to azurev1 instead of azurev1alpha1 |
Looks good, thanks @clmccart ! |
… types (#287) * Foo.name -> Foo.fooName to avoid confusion with FakeResource.name I was getting very confused by what I thought was FakeResource.name being optional, when I hadn't clicked that both FakeResource and Foo have .name and Foo.name is optional. * Deepcopy maps, arrays and optional types This required some special handling in the case of enums. These are handled by adding a flag to the params that suppresses conversion for TypeNames when the type names are the same, since the only thing that will be true for is enums - every other type will have an arm variant generated.. * Removed unnecessary if statement from map copying in ConvertToArm Since we create the target map before the check and iterating over a nil map does the right thing, the `if sourceMap != nil` check isn't needed.
What this PR does / why we need it:
This PR adds additional tests to the resourcegroup_controller_test.go file.
This is necessary because, while using TDD to recreate the resourcegroup operator as an upskilling exercise, I discovered that you could get all of the current resource group controller tests to pass without ever creating or deleting anything in kubernetes or azure.
This PR adds in tests that prove that the resource group controller actually creates and deletes resource group instances.
Special notes for your reviewer:
To test this:
If applicable: