helm-gitea/unittests/helm/dependency-checks/customization-integrity-redis-cluster.yaml
justusbunsi 4691b63f7a Move Helm unittests into subfolder (#750)
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/750
Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Co-committed-by: justusbunsi <sk.bunsenbrenner@gmail.com>
2024-12-18 12:04:15 +00:00

91 lines
2.8 KiB
YAML

suite: Dependency checks | Customization integrity | redis-cluster
release:
name: gitea-unittests
namespace: testing
set:
redis:
enabled: false
redis-cluster:
enabled: true
usePassword: false
cluster:
nodes: 5
replicas: 2
tests:
- it: "[redis-cluster] configures correct nodes/replicas"
template: charts/redis-cluster/templates/redis-statefulset.yaml
asserts:
- documentIndex: 0
equal:
path: spec.replicas
value: 5
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].args[0]
pattern: REDIS_CLUSTER_REPLICAS="2"
- it: "[redis-cluster] support auth-less connections"
asserts:
- template: charts/redis-cluster/templates/secret.yaml
hasDocuments:
count: 0
- template: charts/redis-cluster/templates/redis-statefulset.yaml
documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: ALLOW_EMPTY_PASSWORD
value: "yes"
- it: "[redis-cluster] support auth-full connections"
set:
redis-cluster:
usePassword: true
asserts:
- template: charts/redis-cluster/templates/secret.yaml
containsDocument:
kind: Secret
apiVersion: v1
name: gitea-unittests-redis-cluster
namespace: testing
- template: charts/redis-cluster/templates/redis-statefulset.yaml
documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: REDISCLI_AUTH
valueFrom:
secretKeyRef:
name: gitea-unittests-redis-cluster
key: redis-password
- template: charts/redis-cluster/templates/redis-statefulset.yaml
documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: gitea-unittests-redis-cluster
key: redis-password
- it: "[redis-cluster] renders the referenced service"
template: charts/redis-cluster/templates/headless-svc.yaml
asserts:
- containsDocument:
kind: Service
apiVersion: v1
name: gitea-unittests-redis-cluster-headless
namespace: testing
- documentIndex: 0
contains:
path: spec.ports
content:
name: tcp-redis
port: 6379
targetPort: tcp-redis
- it: "[gitea] waits for redis-cluster to be up and running"
template: templates/gitea/init.yaml
asserts:
- documentIndex: 0
matchRegex:
path: stringData["configure_gitea.sh"]
pattern: nc -vz -w2 gitea-unittests-redis-cluster-headless.testing.svc.cluster.local 6379