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>
This commit is contained in:
Stavros Foteinopoulos 2023-12-14 17:17:09 +02:00 committed by GitHub
parent 6ff70f015d
commit be7f508c73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 288 additions and 1 deletions

View file

@ -0,0 +1,25 @@
suite: Controller > Service > Internal
templates:
- controller-service-internal.yaml
tests:
- it: should not create an internal Service if `controller.service.internal.enabled` is false
set:
controller.service.internal.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create an internal Service if `controller.service.internal.enabled` is true and `controller.service.internal.annotations` are set
set:
controller.service.internal.enabled: true
controller.service.internal.annotations:
test.annotation: "true"
asserts:
- hasDocuments:
count: 1
- isKind:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-internal