-
Notifications
You must be signed in to change notification settings - Fork 64
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
Refactor controller tests into separate suites #3304
Comments
danail-branekov
added a commit
that referenced
this issue
May 27, 2024
danail-branekov
added a commit
that referenced
this issue
May 27, 2024
danail-branekov
added a commit
that referenced
this issue
May 27, 2024
The `Ready` status condition is becoming the standard for Korifi resources, therefore let's get rid of the `Valid` and `Invalid` conditions in favour of the `Ready` one. Thus the CFRoute status reconciliation code could be significantly simplified as we already have the readyConditionBuilder utility in place. Noone seems to care about `Valid`/`Invalid` status conditions, noone cares about the `Ready` condition as well. However, having a standard `Ready` condition is good (see #2098) While being here, `CFRoute.Status.Description` and `CFRoute.Status.CurrentStatus` are removed (as again, noone cares) - hopefully this is not an incompatible change. If anyone ever gets interested whether the route is OK, they should check the `Ready` condition instead. issue: #3304
tcdowney
pushed a commit
that referenced
this issue
May 29, 2024
tcdowney
pushed a commit
that referenced
this issue
May 29, 2024
The `Ready` status condition is becoming the standard for Korifi resources, therefore let's get rid of the `Valid` and `Invalid` conditions in favour of the `Ready` one. Thus the CFRoute status reconciliation code could be significantly simplified as we already have the readyConditionBuilder utility in place. Noone seems to care about `Valid`/`Invalid` status conditions, noone cares about the `Ready` condition as well. However, having a standard `Ready` condition is good (see #2098) While being here, `CFRoute.Status.Description` and `CFRoute.Status.CurrentStatus` are removed (as again, noone cares) - hopefully this is not an incompatible change. If anyone ever gets interested whether the route is OK, they should check the `Ready` condition instead. issue: #3304
danail-branekov
added a commit
that referenced
this issue
May 29, 2024
danail-branekov
added a commit
that referenced
this issue
May 29, 2024
The `Ready` status condition is becoming the standard for Korifi resources, therefore let's get rid of the `Valid` and `Invalid` conditions in favour of the `Ready` one. Thus the CFRoute status reconciliation code could be significantly simplified as we already have the readyConditionBuilder utility in place. Noone seems to care about `Valid`/`Invalid` status conditions, noone cares about the `Ready` condition as well. However, having a standard `Ready` condition is good (see #2098) While being here, `CFRoute.Status.Description` and `CFRoute.Status.CurrentStatus` are removed (as again, noone cares) - hopefully this is not an incompatible change. If anyone ever gets interested whether the route is OK, they should check the `Ready` condition instead. issue: #3304
danail-branekov
added a commit
that referenced
this issue
May 30, 2024
Having controllers in separate packages allows having a suite per a controller. This has several benefits: * The suite setup is significantly simpler - it does not have to wire all the controllers/webhooks. Instead, the setup wires only the controller/webhook that is being tested * Not wiring all the controllers in the test env reduces the noise of unrelated controllers/webhooks. This allows tests to not care about creating "valid" dependent objects, they only create dependent objects with properties that are just relevant to the controller/webhook under test * Tests are no longer required to take side effects from neighbour controllers/webhooks into consideration * Instead of relying on a state change of a dependent object caused by a neightbour controller, the test could simply set the desired state of the dependent object. This makes the test simpler and easy to reason about fixes #3304 wip wip: remove GenerateGUID wip wip
danail-branekov
added a commit
that referenced
this issue
May 30, 2024
Having controllers in separate packages allows having a suite per a controller. This has several benefits: * The suite setup is significantly simpler - it does not have to wire all the controllers/webhooks. Instead, the setup wires only the controller/webhook that is being tested * Not wiring all the controllers in the test env reduces the noise of unrelated controllers/webhooks. This allows tests to not care about creating "valid" dependent objects, they only create dependent objects with properties that are just relevant to the controller/webhook under test * Tests are no longer required to take side effects from neighbour controllers/webhooks into consideration * Instead of relying on a state change of a dependent object caused by a neightbour controller, the test could simply set the desired state of the dependent object. This makes the test simpler and easy to reason about fixes #3304
danail-branekov
added a commit
that referenced
this issue
May 31, 2024
Having controllers in separate packages allows having a suite per a controller. This has several benefits: * The suite setup is significantly simpler - it does not have to wire all the controllers/webhooks. Instead, the setup wires only the controller/webhook that is being tested * Not wiring all the controllers in the test env reduces the noise of unrelated controllers/webhooks. This allows tests to not care about creating "valid" dependent objects, they only create dependent objects with properties that are just relevant to the controller/webhook under test * Tests are no longer required to take side effects from neighbour controllers/webhooks into consideration * Instead of relying on a state change of a dependent object caused by a neightbour controller, the test could simply set the desired state of the dependent object. This makes the test simpler and easy to reason about fixes #3304
danail-branekov
added a commit
that referenced
this issue
May 31, 2024
Having controllers in separate packages allows having a suite per a controller. This has several benefits: * The suite setup is significantly simpler - it does not have to wire all the controllers/webhooks. Instead, the setup wires only the controller/webhook that is being tested * Not wiring all the controllers in the test env reduces the noise of unrelated controllers/webhooks. This allows tests to not care about creating "valid" dependent objects, they only create dependent objects with properties that are just relevant to the controller/webhook under test * Tests are no longer required to take side effects from neighbour controllers/webhooks into consideration * Instead of relying on a state change of a dependent object caused by a neightbour controller, the test could simply set the desired state of the dependent object. This makes the test simpler and easy to reason about fixes #3304
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have realised that having a single controller/webhook in a suite is quite helpful for testing:
The text was updated successfully, but these errors were encountered: