suite: Dependency checks | Customization integrity | valkey
release:
  name: gitea-unittests
  namespace: testing
set:
  valkey-cluster:
    enabled: false
  valkey:
    enabled: true
    architecture: standalone
    global:
      valkey:
        password: gitea-password
    master:
      count: 2
tests:
  - it: "[valkey] configures correct 'master' nodes"
    template: charts/valkey/templates/primary/application.yaml
    asserts:
      - documentIndex: 0
        equal:
          path: spec.replicas
          value: 1
  - it: "[valkey] valkey.global.valkey.password is applied as expected"
    template: charts/valkey/templates/secret.yaml
    asserts:
      - documentIndex: 0
        equal:
          path: data["valkey-password"]
          value: "Z2l0ZWEtcGFzc3dvcmQ="
  - it: "[valkey] renders the referenced service"
    template: charts/valkey/templates/headless-svc.yaml
    asserts:
      - containsDocument:
          kind: Service
          apiVersion: v1
          name: gitea-unittests-valkey-headless
          namespace: testing
      - documentIndex: 0
        contains:
          path: spec.ports
          content:
            name: tcp-redis
            port: 6379
            targetPort: redis
  - it: "[gitea] waits for valkey 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-valkey-headless.testing.svc.cluster.local 6379
