Skip to content

Commit cf8396e

Browse files
test(helm/storage): add cnpg template test
Signed-off-by: Fabrizio Sestito <[email protected]>
1 parent 80f0595 commit cf8396e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
suite: "CNPG Tests"
2+
templates:
3+
- "templates/storage/cnpg.yaml"
4+
tests:
5+
- it: "should not render any resources when CNPG is disabled"
6+
set:
7+
storage:
8+
postgres:
9+
cnpg:
10+
enabled: false
11+
asserts:
12+
- hasDocuments:
13+
count: 0
14+
15+
- it: "should render correct Cluster configuration when CNPG is enabled"
16+
release:
17+
name: test-release
18+
namespace: test-namespace
19+
set:
20+
storage:
21+
postgres:
22+
cnpg:
23+
enabled: true
24+
instances: 5
25+
storage:
26+
size: 2Gi
27+
resizeInUseVolumes: false
28+
storageClass: "fast-ssd"
29+
pvcTemplate:
30+
metadata:
31+
labels:
32+
custom: label
33+
asserts:
34+
- equal:
35+
path: "spec.instances"
36+
value: 5
37+
- equal:
38+
path: "spec.storage.size"
39+
value: "2Gi"
40+
- equal:
41+
path: "spec.storage.resizeInUseVolumes"
42+
value: false
43+
- equal:
44+
path: "spec.storage.storageClass"
45+
value: "fast-ssd"
46+
- equal:
47+
path: "spec.storage.pvcTemplate.metadata.labels.custom"
48+
value: "label"
49+
50+

0 commit comments

Comments
 (0)