Files
helm-gitea/unittests/helm/gatewayAPI/tcpRoute.yaml
T
volker.raschekandCopilot 552fe8c56e
Helm / helm-lint (push) Successful in 9s
changelog / changelog (push) Successful in 29s
Helm / helm-unittest (push) Failing after 21s
Markdown linter / markdown-lint (push) Successful in 17s
Markdown linter / markdown-link-checker (push) Successful in 56s
refactor(templates): move the templates out of the gitea subdirectory
The `templates/gitea` subdirectory did not group anything meaningful, since every template of this chart belongs to
Gitea. It only duplicated the chart name in every path and forced the unit tests to spell out
`templates/gitea/<name>.yaml`, while `_helpers.tpl` and `NOTES.txt` already lived directly in `templates`.

All templates now live in `templates`, which matches the layout of the bundled sub-charts and the Helm defaults.

The checksum helper in `templates/_secrets.tpl` built its include path from `$root.Template.BasePath` and therefore
carried the subdirectory in a `printf` format string instead of a literal path. Without adjusting it the chart failed to
render with "no template gitea/templates/gitea/secret_config.yaml associated with template gotpl".

Co-authored-by: Copilot <copilot@github.com>
2026-09-14 20:28:17 +02:00

80 lines
1.9 KiB
YAML

suite: Test Gateway API tcpRoute.yaml
release:
name: gitea-unittests
namespace: testing
templates:
- templates/tcpRoute.yaml
tests:
- it: should not render when gatewayAPI.enabled is false
set:
gatewayAPI:
enabled: false
core:
tcpRoute:
enabled: true
parentRefs:
- name: shared-gateway
asserts:
- hasDocuments:
count: 0
- it: should not render when tcpRoute.enabled is false
set:
gatewayAPI:
enabled: true
gatewayAPI.core.tcpRoute.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should render a TCPRoute defaulting to the SSH service
set:
gatewayAPI:
enabled: true
core:
tcpRoute:
enabled: true
parentRefs:
- name: shared-gateway
sectionName: ssh
asserts:
- hasDocuments:
count: 1
- isKind:
of: TCPRoute
- equal:
path: apiVersion
value: gateway.networking.k8s.io/v1
- equal:
path: metadata.name
value: gitea-unittests
- equal:
path: spec.parentRefs[0].sectionName
value: ssh
- equal:
path: spec.rules[0].backendRefs[0].group
value: ""
- equal:
path: spec.rules[0].backendRefs[0].kind
value: Service
- equal:
path: spec.rules[0].backendRefs[0].name
value: gitea-unittests-ssh
- equal:
path: spec.rules[0].backendRefs[0].port
value: 22
- equal:
path: spec.rules[0].backendRefs[0].weight
value: 1
- it: should fail when parentRefs missing
set:
gatewayAPI:
enabled: true
core:
tcpRoute:
enabled: true
asserts:
- failedTemplate:
errorMessage: gatewayAPI.core.tcpRoute.parentRefs is required