-
Notifications
You must be signed in to change notification settings - Fork 204
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 for controller with mock #344
add tests for controller with mock #344
Conversation
…om/priyakumarank/azure-service-operator into feat/99-SQLControllerTestsWithMock
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.
Status should remain a sub-resource. Any reason why you chose to remove it?
Just saw your explanation for removing the sub-resource. I understand why you might want to do that but I'd rather we didn't. The tests failing before were reasonable and there was a fix but we just didn't implement it. This is pretty important for the functionality the operators. We will probably update eventhub with it again eventually. |
Fair enough. Investigating why the status subresource breaks the tests was going to be my next to do. I wanted to get this in as the first cut. I understand your concerns, so will split this PR into two, where the first one would get the mock client and the changes to the client to support mock in, so that it enables other team members to work on sql firewall and other sql tests. And the second PR would have the tests with the status subresource fix. |
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.
couple comments, I will test this tomorrow
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 for the most part. You should put the sdkClient in the MockSQLManager instead of passing it as an argument though.
I have updated the gosdkclient as discussed. |
} | ||
r.Recorder.Event(instance, "Normal", "Updated", fmt.Sprintf("finalizer %s added", AzureSQLDatabaseFinalizerName)) | ||
return nil | ||
} |
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.
for future reference...we have some generic functions to replace these in the helper lib.
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, thanks @priyakumarank !
If we panic when writing a file we end up with an empty (or worse) file. The empty file makes `header-check` fail and then you have to manually remove it to re-run any tests you’re doing. So: let’s remove it.
#99
What this PR does / why we need it:
Special notes for your reviewer:
If applicable: