Skip to content

Commit 7d43ce5

Browse files
committed
Fix unit tests with changed file paths
1 parent 0f7d63c commit 7d43ce5

File tree

5 files changed

+48
-48
lines changed

5 files changed

+48
-48
lines changed

charts/sourcegraph/tests/cadvisorPrivileged_test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
suite: cadvisorPrivileged
22
templates:
3-
- NOTES.txt
3+
- other-resources/NOTES.txt
44
- cadvisor/cadvisor.DaemonSet.yaml
55
tests:
66
- it: should not have the warning text when cadvisor.containerSecurityContext.privileged=true
@@ -11,7 +11,7 @@ tests:
1111
asserts:
1212
- notMatchRegexRaw:
1313
pattern: You have set 'cadvisor.containerSecurityContext.privileged' to 'false'
14-
template: NOTES.txt
14+
template: other-resources/NOTES.txt
1515
- it: should have the warning text when prometheus.privileged=false
1616
set:
1717
cadvisor:
@@ -20,7 +20,7 @@ tests:
2020
asserts:
2121
- matchRegexRaw:
2222
pattern: You have set 'cadvisor.containerSecurityContext.privileged' to 'false'
23-
template: NOTES.txt
23+
template: other-resources/NOTES.txt
2424
- it: should render /dev/kmsg in volumes and volumeMounts when cadvisor.containerSecurityContext.privileged=true
2525
set:
2626
cadvisor:

charts/sourcegraph/tests/nodeExporter_test.yaml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
suite: nodeExporter
22
templates:
3-
- NOTES.txt
3+
- other-resources/NOTES.txt
44
- node-exporter/node-exporter.ClusterRole.yaml
55
- node-exporter/node-exporter.ClusterRoleBinding.yaml
66
- node-exporter/node-exporter.DaemonSet.yaml
@@ -9,7 +9,7 @@ templates:
99
- node-exporter/node-exporter.ServiceAccount.yaml
1010
tests:
1111
- it: should render the DaemonSet and Service if node-exporter is enabled
12-
set:
12+
set:
1313
nodeExporter:
1414
enabled: true
1515
asserts:
@@ -25,11 +25,11 @@ tests:
2525
template: node-exporter/node-exporter.Service.yaml
2626

2727
- it: should not render any resources if node-exporter is disabled
28-
set:
28+
set:
2929
nodeExporter:
3030
enabled: false
3131
asserts:
32-
- hasDocuments:
32+
- hasDocuments:
3333
count: 0
3434
templates:
3535
- node-exporter/node-exporter.ClusterRole.yaml
@@ -41,25 +41,25 @@ tests:
4141

4242
- it: should not render the PodSecurityPolicy, Service Accounts, and ClusterRoles by default
4343
asserts:
44-
- hasDocuments:
44+
- hasDocuments:
4545
count: 0
4646
template: node-exporter/node-exporter.PodSecurityPolicy.yaml
47-
- hasDocuments:
47+
- hasDocuments:
4848
count: 0
4949
template: node-exporter/node-exporter.ClusterRole.yaml
50-
- hasDocuments:
50+
- hasDocuments:
5151
count: 0
5252
template: node-exporter/node-exporter.ClusterRoleBinding.yaml
53-
- hasDocuments:
53+
- hasDocuments:
5454
count: 0
5555
template: node-exporter/node-exporter.ServiceAccount.yaml
5656

5757
- it: should render the PodSecurityPolicy, ServiceAccounts, and ClusterRoles if PodSecurityPolicy + Service Accounts are enabled
58-
set:
58+
set:
5959
nodeExporter:
6060
serviceAccount:
6161
create: true
62-
podSecurityPolicy:
62+
podSecurityPolicy:
6363
enabled: true
6464
asserts:
6565
- containsDocument:
@@ -82,9 +82,9 @@ tests:
8282
apiVersion: rbac.authorization.k8s.io/v1
8383
name: node-exporter
8484
template: node-exporter/node-exporter.ClusterRoleBinding.yaml
85-
85+
8686
- it: should add the ServiceAccount name to the DaemonSet spec if the ServiceAccount is enabled
87-
set:
87+
set:
8888
nodeExporter:
8989
serviceAccount:
9090
create: true
@@ -94,9 +94,9 @@ tests:
9494
path: spec.template.spec.serviceAccountName
9595
value: "test-service-account-name"
9696
template: node-exporter/node-exporter.DaemonSet.yaml
97-
97+
9898
- it: should add not the ServiceAccount name to the DaemonSet spec if the ServiceAccount is disabled
99-
set:
99+
set:
100100
nodeExporter:
101101
serviceAccount:
102102
create: false
@@ -105,30 +105,30 @@ tests:
105105
- notExists:
106106
path: spec.template.spec.serviceAccountName
107107
template: node-exporter/node-exporter.DaemonSet.yaml
108-
108+
109109
- it: should fail to render if the PodSecurityPolicy is enabled, but the ServiceAccount isn't
110-
set:
110+
set:
111111
nodeExporter:
112112
serviceAccount:
113113
create: false
114-
podSecurityPolicy:
114+
podSecurityPolicy:
115115
enabled: true
116116
asserts:
117117
- failedTemplate:
118118
errorMessage: "Node Exporter's service account must be enabled in order to use its pod security policy (set 'nodeExporter.ServiceAccount.create' to true)"
119119
template: node-exporter/node-exporter.PodSecurityPolicy.yaml
120120

121-
- it: should not render the podSecurityPolicy if disabled
122-
set:
121+
- it: should not render the podSecurityPolicy if disabled
122+
set:
123123
nodeExporter:
124-
podSecurityPolicy:
124+
podSecurityPolicy:
125125
enabled: false
126126
asserts:
127127
- hasDocuments:
128128
count: 0
129129
template: node-exporter/node-exporter.PodSecurityPolicy.yaml
130-
131-
- it: should ensure that the namespace is properly propagated to the cluster role binding
130+
131+
- it: should ensure that the namespace is properly propagated to the cluster role binding
132132
release:
133133
namespace: "my-test-namespace"
134134
set:
@@ -151,16 +151,16 @@ tests:
151151
create: true
152152
podSecurityPolicy:
153153
enabled: true
154-
asserts:
155-
- equal:
154+
asserts:
155+
- equal:
156156
path: spec.template.spec.hostPID
157157
value: true
158158
template: node-exporter/node-exporter.DaemonSet.yaml
159-
- equal:
159+
- equal:
160160
path: spec.hostPID
161161
value: true
162162
template: node-exporter/node-exporter.PodSecurityPolicy.yaml
163-
163+
164164
- it: should propagate host PID settings to both the daemonset and podSecurityPolicy
165165
set:
166166
nodeExporter:
@@ -170,12 +170,12 @@ tests:
170170
create: true
171171
podSecurityPolicy:
172172
enabled: true
173-
asserts:
174-
- equal:
173+
asserts:
174+
- equal:
175175
path: spec.template.spec.hostPID
176176
value: false
177177
template: node-exporter/node-exporter.DaemonSet.yaml
178-
- equal:
178+
- equal:
179179
path: spec.hostPID
180180
value: false
181181
template: node-exporter/node-exporter.PodSecurityPolicy.yaml
@@ -184,34 +184,34 @@ tests:
184184
set:
185185
nodeExporter:
186186
enabled: true
187-
asserts:
187+
asserts:
188188
- notMatchRegexRaw:
189189
pattern: You have set 'nodeExporter.enabled' to 'false'
190-
template: NOTES.txt
191-
190+
template: other-resources/NOTES.txt
191+
192192
- it: should generate warnings if node-exporter is disabled
193193
set:
194194
nodeExporter:
195195
enabled: false
196-
asserts:
196+
asserts:
197197
- matchRegexRaw:
198198
pattern: You have set 'nodeExporter.enabled' to 'false'
199-
template: NOTES.txt
199+
template: other-resources/NOTES.txt
200200

201201
- it: should not generate warnings if hostPID is true
202202
set:
203203
nodeExporter:
204204
hostPID: true
205-
asserts:
205+
asserts:
206206
- notMatchRegexRaw:
207207
pattern: You have set 'nodeExporter.hostPID' to 'false'
208-
template: NOTES.txt
208+
template: other-resources/NOTES.txt
209209

210-
- it: should generate warnings if hostPID is false
210+
- it: should generate warnings if hostPID is false
211211
set:
212212
nodeExporter:
213213
hostPID: false
214-
asserts:
214+
asserts:
215215
- matchRegexRaw:
216216
pattern: You have set 'nodeExporter.hostPID' to 'false'
217-
template: NOTES.txt
217+
template: other-resources/NOTES.txt

charts/sourcegraph/tests/priorityClass_test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ release:
44
namespace: sourcegraph
55
tests:
66
- it: should render single priority class
7-
template: priorityClass.yaml
7+
template: other-resources/priorityClass.yaml
88
set:
99
priorityClasses:
1010
- name: gitserver-class
@@ -25,7 +25,7 @@ tests:
2525
path: description
2626
value: "gitserver priority class"
2727
- it: should render two priority classes
28-
template: priorityClass.yaml
28+
template: other-resources/priorityClass.yaml
2929
set:
3030
priorityClasses:
3131
- name: gitserver-class
@@ -97,7 +97,7 @@ tests:
9797
path: spec.template.spec.priorityClassName
9898
value: searcher-class
9999
- it: set priority class on redisCache
100-
template: redis/redis-cache.Deployment.yaml
100+
template: redis-cache/redis-cache.Deployment.yaml
101101
set:
102102
redisCache:
103103
priorityClassName: redis-cache-class
@@ -106,7 +106,7 @@ tests:
106106
path: spec.template.spec.priorityClassName
107107
value: redis-cache-class
108108
- it: set priority class on redisStore
109-
template: redis/redis-store.Deployment.yaml
109+
template: redis-store/redis-store.Deployment.yaml
110110
set:
111111
redisStore:
112112
priorityClassName: redis-store-class

charts/sourcegraph/tests/prometheusPrivileged_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
suite: prometheusPrivileged
22
templates:
3-
- NOTES.txt
3+
- other-resources/NOTES.txt
44
tests:
55
- it: should not have the warning text when prometheus.privileged=true
66
set:

charts/sourcegraph/tests/storageClass_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
suite: storageClass
22
templates:
3-
- storageclass.yaml
3+
- other-resources/storageclass.yaml
44
tests:
55
- it: should have parameters rendered when storageClass.parameters.zones=us-central1-f
66
set:

0 commit comments

Comments
 (0)