Skip to content
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

Generate topology for use in unit tests in user implementations. #33

Open
Boomatang opened this issue Sep 27, 2024 · 0 comments
Open

Generate topology for use in unit tests in user implementations. #33

Boomatang opened this issue Sep 27, 2024 · 0 comments
Labels
area/machinery enhancement New feature or request

Comments

@Boomatang
Copy link
Contributor

Boomatang commented 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 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.

@Boomatang 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
@guicassolato guicassolato added enhancement New feature or request area/machinery labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/machinery enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants