Skip to content

Commit 767c283

Browse files
authored
fix(tests): update unittests for common (#498)
1 parent a9c319d commit 767c283

11 files changed

Lines changed: 198 additions & 8 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: common
33
repository: file://../../common
4-
version: 0.10.0
5-
digest: sha256:3d6a3f1644bd43380e14ccf9d8099e397e24078888e355eeca94933f05ef68be
6-
generated: "2026-09-15T11:41:58.823216295+02:00"
4+
version: 0.11.0
5+
digest: sha256:f0669242b27ffb9cc1f92f9f7c8f27be81c896b592629ba0111d74131340e085
6+
generated: "2026-10-27T10:34:16.786556341+02:00"

‎charts/examples/multideployment/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ appVersion: "v0.1.0"
99

1010
dependencies:
1111
- name: common
12-
version: 0.10.0
12+
version: 0.11.0
1313
repository: file://../../common
1414

1515
maintainers:
-9.74 KB
Binary file not shown.
11.5 KB
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: common
33
repository: file://../../common
4-
version: 0.10.0
5-
digest: sha256:3d6a3f1644bd43380e14ccf9d8099e397e24078888e355eeca94933f05ef68be
6-
generated: "2026-09-15T11:45:10.817196242+02:00"
4+
version: 0.11.0
5+
digest: sha256:f0669242b27ffb9cc1f92f9f7c8f27be81c896b592629ba0111d74131340e085
6+
generated: "2026-10-27T10:34:31.131033849+02:00"

‎charts/tests/common-unittests/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ appVersion: "v0.1.0"
99

1010
dependencies:
1111
- name: common
12-
version: 0.10.0
12+
version: 0.11.0
1313
repository: file://../../common
1414

1515
maintainers:
-9.74 KB
Binary file not shown.
11.5 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- define "some-app.pvc" -}}
2+
{{- end }}
3+
{{- include "common.pvc" (list . .Values.persistence "some-app.pvc") }}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
suite: Common - deployment and pod fields
2+
templates:
3+
- deployment.worker.yaml
4+
set:
5+
fullnameOverride: black
6+
tests:
7+
- it: 'renders one replica when replicaCount is absent'
8+
asserts:
9+
- equal:
10+
path: spec.replicas
11+
value: 1
12+
13+
- it: 'keeps an explicit replicaCount of 0, so a stopped deployment stays stopped'
14+
set:
15+
worker:
16+
replicaCount: 0
17+
asserts:
18+
- equal:
19+
path: spec.replicas
20+
value: 0
21+
22+
- it: 'passes any other replicaCount through'
23+
set:
24+
worker:
25+
replicaCount: 3
26+
asserts:
27+
- equal:
28+
path: spec.replicas
29+
value: 3
30+
31+
- it: 'renders no replicas when autoscaling owns them'
32+
set:
33+
worker:
34+
replicaCount: 0
35+
autoscaling:
36+
enabled: true
37+
asserts:
38+
- notExists:
39+
path: spec.replicas
40+
41+
- it: 'leaves revisionHistoryLimit and terminationGracePeriodSeconds to Kubernetes by default'
42+
asserts:
43+
- notExists:
44+
path: spec.revisionHistoryLimit
45+
- notExists:
46+
path: spec.template.spec.terminationGracePeriodSeconds
47+
48+
- it: 'passes revisionHistoryLimit and terminationGracePeriodSeconds through'
49+
set:
50+
worker:
51+
revisionHistoryLimit: 3
52+
terminationGracePeriodSeconds: 60
53+
asserts:
54+
- equal:
55+
path: spec.revisionHistoryLimit
56+
value: 3
57+
- equal:
58+
path: spec.template.spec.terminationGracePeriodSeconds
59+
value: 60
60+
61+
- it: 'renders no automountServiceAccountToken for a named service account by default'
62+
asserts:
63+
- equal:
64+
path: spec.template.spec.serviceAccountName
65+
value: superman
66+
- notExists:
67+
path: spec.template.spec.automountServiceAccountToken
68+
69+
- it: 'mounts the token when there is no service account, as before'
70+
set:
71+
worker:
72+
serviceAccount: null
73+
asserts:
74+
- notExists:
75+
path: spec.template.spec.serviceAccountName
76+
- equal:
77+
path: spec.template.spec.automountServiceAccountToken
78+
value: true
79+
80+
- it: 'honours automountServiceAccountToken false with a named service account'
81+
set:
82+
worker:
83+
automountServiceAccountToken: false
84+
asserts:
85+
- equal:
86+
path: spec.template.spec.serviceAccountName
87+
value: superman
88+
- equal:
89+
path: spec.template.spec.automountServiceAccountToken
90+
value: false
91+
92+
- it: 'honours automountServiceAccountToken false without a service account'
93+
set:
94+
worker:
95+
serviceAccount: null
96+
automountServiceAccountToken: false
97+
asserts:
98+
- equal:
99+
path: spec.template.spec.automountServiceAccountToken
100+
value: false

0 commit comments

Comments
 (0)