You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The policy machinery builds a topology of the network for the developer. The developer at times needs to find resources with in the topology and creates custom functions to search for that resource with the topology. This can be error prone as the custom function needs to allow for edge case like a resource being marked for deletion. Being able to test these custom functions is important.
The ask is to introduce a test controller function that would generate a (simplified) controller to be used in tests. Some of the properties of the test controller would be the setting up with linking functions. Adding, Updating and Deleting resources from the controller. Each of these functions would return two objects, a list of ResourceEvent and the Topology.
This would allow the developer to write unit test for a functions that take a topology or resource events as an input, where the state and order of events is controlled by the developer. This can also be used to test linking functions.
The hope is to create the topology in a manner that can be used in unit testing and not require exists of a cluster and cluster events.
This work ignores the concept of workflows in the controller. Workflows are best tested in integration tests on clusters.
The text was updated successfully, but these errors were encountered:
Boomatang
changed the title
Generate topogloy for use in unit tests in user implementations.
Generate topology for use in unit tests in user implementations.
Sep 27, 2024
The policy machinery builds a topology of the network for the developer. The developer at times needs to find resources with in the topology and creates custom functions to search for that resource with the topology. This can be error prone as the custom function needs to allow for edge case like a resource being marked for deletion. Being able to test these custom functions is important.
The ask is to introduce a test controller function that would generate a (simplified) controller to be used in tests. Some of the properties of the test controller would be the setting up with linking functions. Adding, Updating and Deleting resources from the controller. Each of these functions would return two objects, a list of
ResourceEvent
and theTopology
.This would allow the developer to write unit test for a functions that take a topology or resource events as an input, where the state and order of events is controlled by the developer. This can also be used to test linking functions.
The hope is to create the topology in a manner that can be used in unit testing and not require exists of a cluster and cluster events.
This work ignores the concept of workflows in the controller. Workflows are best tested in integration tests on clusters.
The text was updated successfully, but these errors were encountered: