ingress-nginx-helm/charts/ingress-nginx/tests/controller-deployment_test.yaml
Stavros Foteinopoulos be7f508c73
Add more unit tests to helm chart (#10731)
* Add more unit tests to helm chart

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Use upstream helm-unittest repository

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* Remove non existing value from controller unittest

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* fix unit test

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

---------

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
2023-12-14 16:17:09 +01:00

34 lines
945 B
YAML

suite: Controller > Deployment
templates:
- controller-deployment.yaml
tests:
- it: should create a Deployment
asserts:
- hasDocuments:
count: 1
- isKind:
of: Deployment
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3
set:
controller.replicaCount: 3
asserts:
- equal:
path: spec.replicas
value: 3
- it: should create a Deployment with resource limits if `controller.resources.limits` is set
set:
controller.resources.limits.cpu: 500m
controller.resources.limits.memory: 512Mi
asserts:
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu
value: 500m
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 512Mi