feat: merge upstream change week 2024-31 (#688)
Some checks failed
build / lint-node (push) Has been cancelled
build / lint-helm (push) Has been cancelled
build / e2e (v1.27.13) (push) Has been cancelled
build / e2e (v1.28.9) (push) Has been cancelled
build / e2e (v1.29.4) (push) Has been cancelled
build / e2e (v1.30.2) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled
Some checks failed
build / lint-node (push) Has been cancelled
build / lint-helm (push) Has been cancelled
build / e2e (v1.27.13) (push) Has been cancelled
build / e2e (v1.28.9) (push) Has been cancelled
build / e2e (v1.29.4) (push) Has been cancelled
build / e2e (v1.30.2) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled
Reviewed-on: https://code.forgejo.org/forgejo-helm/forgejo-helm/pulls/688
This commit is contained in:
parent
d000400926
commit
55c599d822
20 changed files with 352 additions and 44 deletions
|
|
@ -8,6 +8,8 @@ tests:
|
|||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -16,11 +18,28 @@ tests:
|
|||
ADAPTER=redis
|
||||
HOST=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "cache is configured correctly for 'memory' when redis-cluster is disabled"
|
||||
- it: 'cache is configured correctly for redis'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.cache
|
||||
value: |-
|
||||
ADAPTER=redis
|
||||
HOST=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "cache is configured correctly for 'memory' when redis (or redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -29,11 +48,13 @@ tests:
|
|||
ADAPTER=memory
|
||||
HOST=
|
||||
|
||||
- it: 'cache can be customized when redis-cluster is disabled'
|
||||
- it: 'cache can be customized when redis (or redis-cluster) is disabled'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.cache.ADAPTER: custom-adapter
|
||||
gitea.config.cache.HOST: custom-host
|
||||
asserts:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ tests:
|
|||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -16,11 +18,28 @@ tests:
|
|||
CONN_STR=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
TYPE=redis
|
||||
|
||||
- it: "queue is configured correctly for 'levelDB' when redis-cluster is disabled"
|
||||
- it: 'queue is configured correctly for redis'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.queue
|
||||
value: |-
|
||||
CONN_STR=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
TYPE=redis
|
||||
|
||||
- it: "queue is configured correctly for 'levelDB' when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -29,11 +48,13 @@ tests:
|
|||
CONN_STR=
|
||||
TYPE=level
|
||||
|
||||
- it: 'queue can be customized when redis-cluster is disabled'
|
||||
- it: 'queue can be customized when redis (and redis-cluster) are disabled'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.queue.TYPE: custom-type
|
||||
gitea.config.queue.CONN_STR: custom-connection-string
|
||||
asserts:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ tests:
|
|||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -16,11 +18,28 @@ tests:
|
|||
PROVIDER=redis
|
||||
PROVIDER_CONFIG=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "session is configured correctly for 'memory' when redis-cluster is disabled"
|
||||
- it: 'session is configured correctly for redis'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.session
|
||||
value: |-
|
||||
PROVIDER=redis
|
||||
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "session is configured correctly for 'memory' when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
|
@ -29,11 +48,13 @@ tests:
|
|||
PROVIDER=memory
|
||||
PROVIDER_CONFIG=
|
||||
|
||||
- it: 'session can be customized when redis-cluster is disabled'
|
||||
- it: 'session can be customized when redis (and redis-cluster) is disabled'
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.session.PROVIDER: custom-provider
|
||||
gitea.config.session.PROVIDER_CONFIG: custom-provider-config
|
||||
asserts:
|
||||
|
|
|
|||
|
|
@ -34,9 +34,24 @@ tests:
|
|||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: ^docker.io/bitnami/redis-cluster:7.+$
|
||||
pattern: bitnami/redis-cluster:7.+$
|
||||
- it: '[redis] ensures we detect major image version upgrades'
|
||||
template: charts/redis/templates/master/application.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: bitnami/redis:7.+$
|
||||
|
|
|
|||
|
|
@ -15,9 +15,33 @@ tests:
|
|||
hosts:
|
||||
- '{{ .Values.global.giteaHostName }}'
|
||||
asserts:
|
||||
- isKind:
|
||||
of: Ingress
|
||||
- equal:
|
||||
path: spec.tls[0].hosts[0]
|
||||
value: 'gitea.example.com'
|
||||
- equal:
|
||||
path: spec.rules[0].host
|
||||
value: 'gitea.example.com'
|
||||
- it: Ingress Class using TPL
|
||||
set:
|
||||
global.ingress.className: 'ingress-class'
|
||||
ingress.className: '{{ .Values.global.ingress.className }}'
|
||||
ingress.enabled: true
|
||||
ingress.hosts[0].host: 'some-host'
|
||||
ingress.tls:
|
||||
- secretName: gitea-tls
|
||||
hosts:
|
||||
- 'some-host'
|
||||
asserts:
|
||||
- isKind:
|
||||
of: Ingress
|
||||
- equal:
|
||||
path: spec.tls[0].hosts[0]
|
||||
value: 'some-host'
|
||||
- equal:
|
||||
path: spec.rules[0].host
|
||||
value: 'some-host'
|
||||
- equal:
|
||||
path: spec.ingressClassName
|
||||
value: 'ingress-class'
|
||||
|
|
|
|||
|
|
@ -59,3 +59,70 @@ tests:
|
|||
- equal:
|
||||
path: spec.ports[0].targetPort
|
||||
value: 2222
|
||||
|
||||
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer
|
||||
template: templates/gitea/ssh-svc.yaml
|
||||
set:
|
||||
service:
|
||||
ssh:
|
||||
loadBalancerClass: 'example.com/class'
|
||||
type: LoadBalancer
|
||||
loadBalancerIP: '1.2.3.4'
|
||||
loadBalancerSourceRanges:
|
||||
- '1.2.3.4/32'
|
||||
- '5.6.7.8/32'
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.loadBalancerClass
|
||||
value: 'example.com/class'
|
||||
- equal:
|
||||
path: spec.loadBalancerIP
|
||||
value: '1.2.3.4'
|
||||
- equal:
|
||||
path: spec.loadBalancerSourceRanges
|
||||
value: ['1.2.3.4/32', '5.6.7.8/32']
|
||||
|
||||
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass
|
||||
template: templates/gitea/http-svc.yaml
|
||||
set:
|
||||
service:
|
||||
http:
|
||||
type: ClusterIP
|
||||
loadBalancerClass: 'example.com/class'
|
||||
loadBalancerIP: '1.2.3.4'
|
||||
loadBalancerSourceRanges:
|
||||
- '1.2.3.4/32'
|
||||
- '5.6.7.8/32'
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.loadBalancerClass
|
||||
- notExists:
|
||||
path: spec.loadBalancerIP
|
||||
- notExists:
|
||||
path: spec.loadBalancerSourceRanges
|
||||
|
||||
- it: does not render loadBalancerClass by default even when type is LoadBalancer
|
||||
template: templates/gitea/http-svc.yaml
|
||||
set:
|
||||
service:
|
||||
http:
|
||||
type: LoadBalancer
|
||||
loadBalancerIP: '1.2.3.4'
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.loadBalancerClass
|
||||
- equal:
|
||||
path: spec.loadBalancerIP
|
||||
value: '1.2.3.4'
|
||||
|
||||
- it: both ssh and http services exist
|
||||
templates:
|
||||
- templates/gitea/ssh-svc.yaml
|
||||
- templates/gitea/http-svc.yaml
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: metadata.name
|
||||
pattern: '^gitea-unittests-forgejo-(?:ssh|http)$'
|
||||
- matchRegex:
|
||||
path: spec.ports[0].name
|
||||
pattern: '^(?:ssh|http)$'
|
||||
|
|
|
|||
19
unittests/pvc/pvc-configuration.yaml
Normal file
19
unittests/pvc/pvc-configuration.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
suite: PVC template
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/gitea/pvc.yaml
|
||||
tests:
|
||||
- it: Storage Class using TPL
|
||||
set:
|
||||
global.persistence.storageClass: 'storage-class'
|
||||
persistence.enabled: true
|
||||
persistence.create: true
|
||||
persistence.storageClass: '{{ .Values.global.persistence.storageClass }}'
|
||||
asserts:
|
||||
- isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- equal:
|
||||
path: spec.storageClassName
|
||||
value: 'storage-class'
|
||||
14
unittests/values-conflicting-checks.yaml
Normal file
14
unittests/values-conflicting-checks.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
suite: Values conflicting checks
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: fails when trying to configure redis and redis-cluster the same time
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: redis and redis-cluster cannot be enabled at the same time. Please only choose one.
|
||||
Loading…
Add table
Add a link
Reference in a new issue