Skip to content

Commit e1457a9

Browse files
feat: add separate redis for cf-argocd-extras and app-proxy
1 parent 4b4073f commit e1457a9

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
2+
suite: redis tests
3+
templates:
4+
- cf-argocd-extras/**/*.yaml
5+
- app-proxy/deployment.yaml
6+
- redis/**
7+
- charts/redis-ha/**
8+
tests:
9+
- it: Standalone Redis Deployment should be created by default
10+
template: redis/deployment.yaml
11+
values:
12+
- ./values/mandatory-values-ingress.yaml
13+
asserts:
14+
- containsDocument:
15+
kind: Deployment
16+
apiVersion: apps/v1
17+
name: redis
18+
19+
- it: Redis HA StatefulSet should be created when redis-ha.enabled is true
20+
template: charts/redis-ha/templates/redis-ha-statefulset.yaml
21+
values:
22+
- ./values/mandatory-values-ingress.yaml
23+
set:
24+
redis-ha.enabled: true
25+
asserts:
26+
- containsDocument:
27+
kind: StatefulSet
28+
apiVersion: apps/v1
29+
name: redis-ha-server
30+
- containsDocument:
31+
kind: Deployment
32+
apiVersion: apps/v1
33+
name: redis
34+
not: true
35+
36+
- it: App-Proxy should have CACHE_ environment variables (standalone Redis)
37+
template: app-proxy/deployment.yaml
38+
values:
39+
- ./values/mandatory-values-ingress.yaml
40+
asserts:
41+
- equal:
42+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_HOST")].value
43+
value: redis
44+
- equal:
45+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_PORT")].value
46+
value: "6379"
47+
- equal:
48+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_PASSWORD")].valueFrom
49+
value:
50+
secretKeyRef:
51+
name: gitops-runtime-redis
52+
key: auth
53+
54+
- it: App-Proxy should have CACHE_ environment variables (Redis HA)
55+
template: app-proxy/deployment.yaml
56+
values:
57+
- ./values/mandatory-values-ingress.yaml
58+
set:
59+
redis-ha.enabled: true
60+
asserts:
61+
- equal:
62+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_HOST")].value
63+
value: redis-ha-haproxy
64+
- equal:
65+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_PORT")].value
66+
value: "6379"
67+
- equal:
68+
path: spec.template.spec.containers[0].env[?(@.name=="CACHE_PASSWORD")].valueFrom
69+
value:
70+
secretKeyRef:
71+
name: gitops-runtime-redis
72+
key: auth

0 commit comments

Comments
 (0)