
### Description of the change This adds unittests for the default configuration of our dependencies. ### Benefits We are able to detect changes in upstream Charts for those settings. ### Applicable issues - fixes #409 ### Additional information I merged existing unittests with the new ones for `postgresql-ha` and `postgresql`. However, I decided to not do this for `redis-cluster` and `redis`, because the existing tests[^1] also ensure how the Chart behaves when both redis dependencies are disabled. It didn't felt right to split those files. ### Checklist - [x] Templating unittests are added Signed-off-by: justusbunsi <sk.bunsenbrenner@gmail.com> [^1]:e733287dc2/unittests/config/cache-config.yaml
,e733287dc2/unittests/config/queue-config.yaml
,e733287dc2/unittests/config/session-config.yaml
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/748 Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com> Co-committed-by: justusbunsi <sk.bunsenbrenner@gmail.com>
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
suite: Dependency checks | Customization integrity | redis
|
|
release:
|
|
name: gitea-unittests
|
|
namespace: testing
|
|
set:
|
|
redis-cluster:
|
|
enabled: false
|
|
redis:
|
|
enabled: true
|
|
architecture: standalone
|
|
global:
|
|
redis:
|
|
password: gitea-password
|
|
master:
|
|
count: 2
|
|
tests:
|
|
- it: "[redis] configures correct 'master' nodes"
|
|
template: charts/redis/templates/master/application.yaml
|
|
asserts:
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.replicas
|
|
value: 2
|
|
- it: "[redis] redis.global.redis.password is applied as expected"
|
|
template: charts/redis/templates/secret.yaml
|
|
asserts:
|
|
- documentIndex: 0
|
|
equal:
|
|
path: data["redis-password"]
|
|
value: "Z2l0ZWEtcGFzc3dvcmQ="
|
|
- it: "[redis] renders the referenced service"
|
|
template: charts/redis/templates/headless-svc.yaml
|
|
asserts:
|
|
- containsDocument:
|
|
kind: Service
|
|
apiVersion: v1
|
|
name: gitea-unittests-redis-headless
|
|
namespace: testing
|
|
- documentIndex: 0
|
|
contains:
|
|
path: spec.ports
|
|
content:
|
|
name: tcp-redis
|
|
port: 6379
|
|
targetPort: redis
|
|
- it: "[gitea] waits for redis 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-headless.testing.svc.cluster.local 6379
|