Files
helm-gitea/unittests/helm/ingress/ingress.yaml
T
volker.raschekandCopilot 761921faed test(ingress): align assertions with the release name and namespace
The suite header was changed to the release `gitea-unittests` in the namespace `testing`, but the assertions still
expected the previous `gitea-unittest` and `gitea-debug`. That made four cases fail on the rendered resource name, the
`app.kubernetes.io/instance` label and the backend Service name.

Renovate comments had additionally been copied into the expected `app.kubernetes.io/version` and `version` label values.
They only matched by accident, because YAML strips the trailing comment from an unquoted scalar. Removing them keeps the
assertions honest about what is actually compared.

Co-authored-by: Copilot <copilot@github.com>
2026-09-14 15:24:55 +02:00

144 lines
3.6 KiB
YAML

chart:
appVersion: 1.27.3
release:
name: gitea-unittests
namespace: testing
suite: Test ingress.yaml
templates:
- templates/gitea/ingress.yaml
tests:
- it: Skip ingress if ingress is disabled
set:
ingress.enabled: false
service.http.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Skip ingress if HTTP Service is disabled
set:
ingress.enabled: true
service.http.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Skip ingress if both ingress and HTTP Service are disabled
set:
ingress.enabled: false
service.http.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Render ingress with default values
set:
ingress.enabled: true
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- notExists:
path: metadata.annotations
- isSubset:
path: metadata.labels
content:
app: gitea
app.kubernetes.io/instance: gitea-unittests
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: gitea
app.kubernetes.io/version: 1.27.3
helm.sh/chart: gitea-0.0.0
version: 1.27.3
- equal:
path: spec.ingressClassName
value: nginx
- contains:
path: spec.rules
content:
host: git.example.com
http:
paths:
- backend:
service:
name: gitea-unittests-http
port:
number: 3000
path: /
pathType: Prefix
- it: Render ingress with TLS
set:
ingress.enabled: true
ingress.tls:
- hosts:
- git.example.com
secretName: tls-secret
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- contains:
path: spec.tls
content:
hosts:
- git.example.com
secretName: tls-secret
- it: Render ingress with custom HTTP service spec
set:
ingress.enabled: true
service.http.enabled: true
service.http.port: 32000
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- contains:
path: spec.rules
content:
host: git.example.com
http:
paths:
- backend:
service:
name: gitea-unittests-http
port:
number: 32000
path: /
pathType: Prefix
- it: Render ingress with custom annotations and labels
set:
ingress.enabled: true
ingress.annotations:
custom-annotation: custom-value
ingress.labels:
custom-label: custom-value
service.http.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: Ingress
apiVersion: networking.k8s.io/v1
name: gitea-unittests
namespace: testing
- isSubset:
path: metadata.annotations
content:
custom-annotation: custom-value
- isSubset:
path: metadata.labels
content:
custom-label: custom-value