-
Notifications
You must be signed in to change notification settings - Fork 718
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
Transform dynamic watches integration tests into unit tests #911
Conversation
This commit sets up a unit test to cover the integration test scenario we had for the DynamicEnqueueRequest handler. A very basic integration test is left to ensure everything correctly fits together, but most of the logic we wanted to test (and a bit more) is moved into the unit test. Main benefits: * remove complexity from IT complexity (edge cases of 1-2 potential reconciliations, wait for something to not happen) * remove dependency to test.Timeout in most tests (used both in `CheckReconcileCalledIn` and `CheckReconcileNotCalledWithin`) * faster execution time
|
||
// StartManager sets up a manager and controller to perform reconciliations in background. | ||
// It must be stopped by calling the returned function. | ||
func StartManager(t *testing.T, addToMgrFunc func(manager.Manager, operator.Parameters) error, parameters operator.Parameters) (k8s.Client, func()) { |
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.
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.
Much better than what we had before!
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.
LGTM
jenkins test this please |
This commit sets up a unit test to cover the integration test scenario
we had for the DynamicEnqueueRequest handler. A very basic integration
test is left to ensure everything correctly fits together, but most of
the logic we wanted to test (and a bit more) is moved into the unit test.
Main benefits:
wait for something to not happen)
CheckReconcileCalledIn
andCheckReconcileNotCalledWithin
)Fixes #908.