-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Clean up Revision test code. #1219
Comments
In order to use the new testing style I believe all |
* Revision controller table testing. This sets up the skeleton for writing table tests for the Revision controller, and adds a number of tests for it. The bulk of the Revision controller behavior is now covered by the table-based test. The notable gaps in coverage where `revision_test.go` still meaningfully increases coverage are the fluentd and VPA paths, which are flag guarded. Covering these gaps is possible via this method, but they must be switched to `.Get()` through an informer lister that we can fake and the flag to enable this functionality passed. Another notable difference from `revision_test.go` is that the table test doesn't make the same effort to test things like label propagation, which IMO should be done through more focused unit testing of the utilities that Reconcile builds upon instead of through Reconcile itself. I believe this is far enough along that we should focus on adding new testing here instead of `revision_test.go` whenever possible. Related: #1219 * Hoist some of the boilerplate from the main loop of the table test. * Generalize the controller table test loop. This moves the implementation of the table test the controllers are moving towards into a common location. Since the loop is already designed to be fairly generic, this is a relatively straightforward move with no appreciable change in the logic from what was in Revision's `table_test.go`. This does effectively backport some of the improvements made to the core logic to Service and Configuration. * Comment out a useful logging line that we probably don't want on by default.
I think the main piece of this that's remaining is coverage of the VPA code, which is blocked on the VPA stuff switching to informers/listers. Especially with #1501 available, the VPA stuff is definitely the most obvious gap in our coverage. |
Going to close this in favor of move the VPA stuff into the autoscaling controller. |
Refactor the
Revision
controller tests to use the pattern adopted in #1216.The text was updated successfully, but these errors were encountered: