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

Add golden file tests for infrastructure update case #653

Open
2 tasks
lucastt opened this issue Oct 31, 2023 · 0 comments
Open
2 tasks

Add golden file tests for infrastructure update case #653

lucastt opened this issue Oct 31, 2023 · 0 comments

Comments

@lucastt
Copy link
Contributor

lucastt commented Oct 31, 2023

Problem

Currently we only test the creation of new infrastructure based on k8s resources - e.g. Ingress, RouteGroup etc - but we don't test update actions, when we already have infrastructure created and something changes in k8s cluster resulting in a update of the infrastructure.

For example: For some specific reason we need that a RouteGroup don't share an LB anymore and previously it shared an LB with an existing ingress. In the case the ingress-controller will use the update function to change the existing stack and also will create a new stack for RouteGroup LB.

What is the goal of the topic? (optional)

Improve test coverage in kube-aws-ingress-controller.

Impact

With better coverage we will increase our confidence in changes to the component and also will improve the understanding of the code base.

Solution

What needs to be changed?

In ./aws/fake/cf.go in the UpdateStack mock we should not use the same variables to store history of changes as CreateStack because this can create bugs.

To accomplish the goal of this task we need to create logic to store history of changes so we can compare with a Golden file the same way we do with Golden file tests for stack creation.

With this new logic in the mock we will be able to create tests around stack updates too.

Acceptance criteria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant