Skip to content

Commit 7d90b4a

Browse files
committed
test(valkey): add default render helm unit tests
valkey was one of the remaining user-facing apps with no helm-unittest coverage. Signed-off-by: Akanksha Trehun <[email protected]>
1 parent 56e10b1 commit 7d90b4a

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

‎packages/apps/valkey/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
include ../../../hack/package.mk
22

3+
.PHONY: test
4+
test:
5+
helm unittest .
6+
37
generate:
48
cozyvalues-gen -m 'valkey' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/valkey/types.go
59
../../../hack/update-crd.sh
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
suite: valkey default render
2+
templates:
3+
- templates/valkeyfailover.yaml
4+
5+
release:
6+
name: valkey-test
7+
namespace: tenant-test
8+
9+
tests:
10+
- it: renders an auth Secret with a generated password
11+
asserts:
12+
- hasDocuments:
13+
count: 4
14+
- isKind:
15+
of: Secret
16+
documentIndex: 0
17+
- equal:
18+
path: metadata.name
19+
value: valkey-test-auth
20+
documentIndex: 0
21+
- exists:
22+
path: data.password
23+
documentIndex: 0
24+
25+
- it: renders a RedisFailover with the default engine, replicas and storage size
26+
asserts:
27+
- isKind:
28+
of: RedisFailover
29+
documentIndex: 1
30+
- equal:
31+
path: spec.engine
32+
value: Valkey
33+
documentIndex: 1
34+
- equal:
35+
path: spec.redis.image
36+
value: "valkey/valkey:8.1.8"
37+
documentIndex: 1
38+
- equal:
39+
path: spec.redis.replicas
40+
value: 2
41+
documentIndex: 1
42+
- equal:
43+
path: spec.redis.storage.persistentVolumeClaim.spec.resources.requests.storage
44+
value: 1Gi
45+
documentIndex: 1
46+
- equal:
47+
path: spec.sentinel.replicas
48+
value: 3
49+
documentIndex: 1
50+
51+
- it: renders WorkloadMonitors for the valkey and sentinel roles
52+
asserts:
53+
- isKind:
54+
of: WorkloadMonitor
55+
documentIndex: 2
56+
- equal:
57+
path: metadata.name
58+
value: valkey-test-valkey
59+
documentIndex: 2
60+
- equal:
61+
path: spec.replicas
62+
value: 2
63+
documentIndex: 2
64+
- isKind:
65+
of: WorkloadMonitor
66+
documentIndex: 3
67+
- equal:
68+
path: metadata.name
69+
value: valkey-test-sentinel
70+
documentIndex: 3
71+
- equal:
72+
path: spec.replicas
73+
value: 3
74+
documentIndex: 3

0 commit comments

Comments
 (0)