-
Notifications
You must be signed in to change notification settings - Fork 103
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
Remove Kubebuilder Generated Tests #358
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.
I think that kubebuilder test harness actually brings a lot of value to the table. I wouldn't know how to mock the API server (or if it is even possible) and relying solely on SI tests is IMHO not an option. If anything, we should add more tests, especially for the controllers.
@zen-dog we do have efforts to increase our integration testing landing nearly concurrently to this (see KEP-0008 and KEP-0004), this is simply removing autogenerated tests that do nothing except for start the control plane and cause flakiness. |
Two things:
See this #363 for more context. |
Yeah.... See: https://github.com/kudobuilder/kudo/blob/master/keps/0004-add-testing-infrastructure.md#tests The test harness itself supports integration (using only a mocked etcd and kubernetes API) as well as end-to-end tests (for testing frameworks). You can also write Go-based integration and unit tests.
Nothing prevents you from writing these tests, this PR only removes these autogenerated stubs. They currently start the envtest environment for each of these stubs (each takes around 5 seconds), so it just adds wasted time as well as making it more likely for us to hit issues like #302. We should of course fix flakes as they come up, but keeping these stubs around is not the way to do that IMO. |
We have some tests that do this already that are not being removed: https://github.com/kudobuilder/kudo/blob/master/pkg/test/utils/kubernetes_test.go#L55 Though, note that your test could be written as a regular integration test using the KUDO test harness and doesn't actually need to be written in Go, see:
Those integration tests are run against the envtest environment and not a Kubernetes cluster. |
Agreed, let's remove the "unused" TestMains. However, my PR uses the one in instance_controller_test_suite so let's leave the instance controller tests out to not produce unnecessary conflicts /cc @kensipe |
I'd prefer if we could use the declarative test harness for writing your test. And leave this PR as is. |
c83f1aa
to
64da5a0
Compare
What type of PR is this?
What this PR does / why we need it:
Removes generated kubebuilder tests and TestMains
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: