-
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
Test refactoring #153
Test refactoring #153
Conversation
* feat: implement keyvault controller * Ace's KV changes with updates * Added an event for the final successful provisioning * Updated changes based on the PR comments * removing unwanted file * making resource group name the one in the keyvault yaml Co-authored-by: Ace Eldeib <alexeldeib@gmail.com>
This reverts commit 594c5cd.
…azure-service-operator into test-refactors
Expect(apierrors.IsInvalid(err)).To(Equal(false)) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
// prep query gor Get |
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.
// prep query gor Get | |
// prep query for Get |
note: the output needs some work still for sure |
Part of the goal here is to be able to debug individual tests from within the IDE. I think the build flags will need to be removed for that. |
Hi @frodopwns Some comments/questions/observations:
Totally agree with this - can't say I ever quite drank the BDD kool-aid myself
Can/will it accommodate synchronized shared setup and teardown?
I've been using focus specs
So far my experience has been pretty average. I have been able to improve it a little with this PR to improve the existing tests (#172). In fact happy to get rid of Ginkgo and move to go test, provided one can do common test setup, run several tests in parallel, then do common teardown. |
}, tcfg.Timeout, tcfg.Poll, | ||
).Should(BeTrue()) | ||
|
||
} |
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.
Secret test been removed?
(maybe they should be tested separately anyway)
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.
This PR shouldn't be considered as ready to merge so much as a proposal to abandon Ginkkgo.
|
||
consumerGroupNamespacedName := types.NamespacedName{Name: consumerGroupName, Namespace: "default"} | ||
|
||
Eventually(func() bool { |
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.
Do we want to carry on using the Gomega assertions?
some other assertion lib?
@@ -115,3 +116,25 @@ func (eventhub *Eventhub) AddFinalizer(finalizerName string) { | |||
func (eventhub *Eventhub) RemoveFinalizer(finalizerName string) { | |||
eventhub.ObjectMeta.Finalizers = helpers.RemoveString(eventhub.ObjectMeta.Finalizers, finalizerName) | |||
} | |||
|
|||
func NewTestEventhub(cfg TestConfig, namespace string) *Eventhub { |
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 Simplicity Please move this function to a separate file that contains all the initializations for the test.
@@ -99,3 +99,16 @@ func (eventhubNamespace *EventhubNamespace) AddFinalizer(finalizerName string) { | |||
func (eventhubNamespace *EventhubNamespace) RemoveFinalizer(finalizerName string) { | |||
eventhubNamespace.ObjectMeta.Finalizers = helpers.RemoveString(eventhubNamespace.ObjectMeta.Finalizers, finalizerName) | |||
} | |||
|
|||
func NewTestEventhubNamespace(cfg TestConfig) *EventhubNamespace { |
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 Simplicity Please move this function to a separate file that contains all the initializations for the test
@@ -83,3 +83,15 @@ func (resourceGroup *ResourceGroup) AddFinalizer(finalizerName string) { | |||
func (resourceGroup *ResourceGroup) RemoveFinalizer(finalizerName string) { | |||
resourceGroup.ObjectMeta.Finalizers = helpers.RemoveString(resourceGroup.ObjectMeta.Finalizers, finalizerName) | |||
} | |||
|
|||
func NewTestResourceGroup(cfg TestConfig) *ResourceGroup { |
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 Simplicity Please move this function to a separate file that contains all the initializations for the test
I don’t have any preference in terms of a testing framework the only comment I would add there are some drawbacks if branch out from kubebuilder test framework
|
Currently it allows a Global setup/teardown. It happens before parallelization starts, so I'm assuming it is "synchronized".
I've never heard of this which immediately makes me not like it. Normal go tests can be isolated simply from the VSCode IDE code lenses.
This is possible and exists in this PR. I'm not dead set on making this change. For the most part I wanted to draw attention to the state of the tests which were hard to run and harder to debug. Which is the opposite of how we want the tests. |
The only issue preventing
The tests in master aren't currently being run in parallel (I think?), so I didn't compare them. I would expect performance not to change otherwise.
I'm not aware of anything coming down the line that would be useful to us wrt testing.
Having more go-like testing should be a boon to new devs on the project as it would match their expectation more closely. |
I think I have a new proposal. The more I think about it, the more I think the controller tests in The end-to-end integration tests should be run against a live AKS cluster. I'd like to see this take the form of actual applications that get deployed using the operator. Some apps like this already exist in the Azure world. eg. https://github.com/Azure-Samples/azure-voting-app-redis |
closing this PR...discussed with stakeholders.... new plan is to make improvements to the current ginkgo usage and slowly move toward mocked azure interaction in the |
- No change in CI, but this makes it easier to catch missing headers in the generator files before opening PRs.
What this PR does / why we need it:
This PR rips out ginkgo for controller integration testing. My experience with Ginkgo has largely been poor and at this point, I believe we can get by without it.
The tests can all be run in parallel.
Run via
or
If you are unsure whether all tests passed:
echo $?
to get the exit code