Skip to content

Commit fccb7fe

Browse files
committed
test(tests): fail absence-only cases when the template renders nothing
Each of these templates is wrapped in a top-level condition, and the case asserts only that a field is absent. If a values change turns the condition off, the render is empty and the absence holds trivially, so the case passes without looking at anything. A document selector makes an empty render fail with "document not found". Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent ef5ef06 commit fccb7fe

5 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎packages/apps/kubernetes/tests/cilium_gateway_alpn_test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ values:
55
- values-ci.yaml
66
tests:
77
- it: renders no gatewayAPI block when the gatewayAPI addon is disabled
8+
documentSelector:
9+
path: kind
10+
value: HelmRelease
811
set:
912
addons:
1013
gatewayAPI:

‎packages/apps/mongodb/tests/restore_test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ tests:
286286
#####################
287287

288288
- it: does not set pitr when recoveryTime not specified
289+
documentSelector:
290+
path: kind
291+
value: PerconaServerMongoDBRestore
289292
release:
290293
name: test-mongodb
291294
namespace: tenant-test

‎packages/system/linstor-scheduler/tests/admission_test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ tests:
152152
# annotation is emitted. Pin the absence: re-enabling the knob would buy only
153153
# a redundant pod restart on every cert-manager renewal.
154154
- it: emits no Reloader annotation, the webhook reloads its own certificate
155+
documentSelector:
156+
path: kind
157+
value: Deployment
155158
template: charts/linstor-scheduler/templates/admission-deployment.yaml
156159
asserts:
157160
- notExists:

‎packages/system/seaweedfs/tests/s3_traffic_distribution_test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ tests:
3535
value: PreferSameZone
3636

3737
- it: omits the field on Kubernetes 1.30 (below the 1.31 gate)
38+
documentSelector:
39+
path: kind
40+
value: Service
3841
capabilities:
3942
majorVersion: 1
4043
minorVersion: 30

‎packages/system/vertical-pod-autoscaler/tests/vpa_test.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ tests:
110110
# will regress to the same infinite-rotation loop from a different angle
111111
# (any change to Certificate metadata would flip the sha).
112112
- it: certManagerEnabled=true does NOT set checksum/tls-secret on the admission-controller pod
113+
documentSelector:
114+
path: kind
115+
value: Deployment
113116
set:
114117
vertical-pod-autoscaler.admissionController.tls.certManagerEnabled: true
115118
template: charts/vertical-pod-autoscaler/templates/admission-controller/deployment.yaml
@@ -189,6 +192,9 @@ tests:
189192
# outside its `if` gate, this catches it before it hits a customer
190193
# cluster and starts a fresh ReplicaSet-churn incident.
191194
- it: existingSecret emits neither tls-secret nor tls-cert checksum on the admission-controller pod
195+
documentSelector:
196+
path: kind
197+
value: Deployment
192198
set:
193199
vertical-pod-autoscaler.admissionController.tls.existingSecret: my-external-tls
194200
vertical-pod-autoscaler.admissionController.tls.certManagerEnabled: true
@@ -207,6 +213,9 @@ tests:
207213
# `admissionController disabled` test group below (which confirms no
208214
# unrelated annotation leaks).
209215
- it: certManagerEnabled=true does NOT emit checksum/tls-cert during offline render (lookup returns nil)
216+
documentSelector:
217+
path: kind
218+
value: Deployment
210219
set:
211220
vertical-pod-autoscaler.admissionController.tls.certManagerEnabled: true
212221
template: charts/vertical-pod-autoscaler/templates/admission-controller/deployment.yaml

0 commit comments

Comments
 (0)