Skip to content

Commit 40dd971

Browse files
committed
test(rabbitmq): add default render helm unit tests
rabbitmq was one of the remaining user-facing apps with no helm-unittest coverage. Assisted-by: LLM Signed-off-by: Akanksha Trehun <[email protected]>
1 parent 3a369fe commit 40dd971

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

‎packages/apps/rabbitmq/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ generate:
77
update:
88
hack/update-versions.sh
99
make generate
10+
11+
.PHONY: test
12+
test:
13+
helm unittest .
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
suite: rabbitmq default render
2+
templates:
3+
- templates/rabbitmq.yaml
4+
5+
release:
6+
name: rabbitmq-test
7+
namespace: tenant-test
8+
9+
tests:
10+
- it: renders a RabbitmqCluster with the default version, replicas and storage size
11+
asserts:
12+
- hasDocuments:
13+
count: 1
14+
- isKind:
15+
of: RabbitmqCluster
16+
- equal:
17+
path: spec.replicas
18+
value: 3
19+
- equal:
20+
path: spec.image
21+
value: "rabbitmq:4.2.4-management"
22+
- equal:
23+
path: spec.persistence.storage
24+
value: 10Gi
25+
26+
- it: renders a User and credentials Secret for a configured user with an explicit password
27+
set:
28+
users:
29+
alice:
30+
password: s3cr3t
31+
asserts:
32+
- hasDocuments:
33+
count: 3
34+
- equal:
35+
path: kind
36+
value: RabbitmqCluster
37+
documentIndex: 0
38+
- equal:
39+
path: kind
40+
value: User
41+
documentIndex: 1
42+
- equal:
43+
path: metadata.name
44+
value: rabbitmq-test-alice
45+
documentIndex: 1
46+
- equal:
47+
path: kind
48+
value: Secret
49+
documentIndex: 2
50+
- equal:
51+
path: metadata.name
52+
value: rabbitmq-test-alice-credentials
53+
documentIndex: 2
54+
- equal:
55+
path: stringData.username
56+
value: alice
57+
documentIndex: 2
58+
- equal:
59+
path: stringData.password
60+
value: s3cr3t
61+
documentIndex: 2

0 commit comments

Comments
 (0)