Skip to content

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

@Boomatang

Description

@Boomatang

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions