helm-charts/charts/library/common-test/tests/service/metadata_test.yaml
Bernd Schorgers 8b33237e27
feat(common): Release library 3.7.0 (#377)
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
Co-authored-by: Patrick Collins <Patricol@users.noreply.github.com>
Co-authored-by: Patrick Collins <patrick.collins@gainbridge.io>
Co-authored-by: Lawrence Gil <larrywtf609@gmail.com>
Co-authored-by: solidDoWant <fred.heinecke@yahoo.com>
2025-02-07 20:03:04 +01:00

84 lines
2.4 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: service metadata
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default metadata
values:
- ../_values/service_main_default.yaml
documentSelector: &ServiceSelector
path: $[?(@.kind == "Service")].metadata.name
value: RELEASE-NAME
asserts:
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- it: custom metadata
values:
- ../_values/service_main_default.yaml
set:
service:
main:
annotations:
test_annotation: test
labels:
test_label: test
documentSelector: *ServiceSelector
asserts:
- equal:
path: metadata.annotations
value:
test_annotation: test
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
test_label: test
- it: custom metadata with global metadata
values:
- ../_values/service_main_default.yaml
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
service:
main:
annotations:
test_annotation: test
labels:
test_label: test
documentSelector: *ServiceSelector
asserts:
- equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
global_label: test
helm.sh/chart: common-test-1.0.0
test_label: test