2025-03-30 23:13:31 +00:00
|
|
|
suite: actions template | job
|
|
|
|
|
release:
|
|
|
|
|
name: gitea-unittests
|
|
|
|
|
namespace: testing
|
|
|
|
|
chart:
|
|
|
|
|
# Override appVersion to have a pinned version for comparison
|
|
|
|
|
appVersion: 1.23.6
|
|
|
|
|
templates:
|
|
|
|
|
- templates/job.yaml
|
|
|
|
|
tests:
|
|
|
|
|
- it: renders a Job
|
|
|
|
|
template: templates/job.yaml
|
|
|
|
|
set:
|
|
|
|
|
enabled: true
|
|
|
|
|
provisioning:
|
|
|
|
|
enabled: true
|
|
|
|
|
persistence:
|
|
|
|
|
enabled: true
|
|
|
|
|
mount: true
|
|
|
|
|
asserts:
|
|
|
|
|
- hasDocuments:
|
|
|
|
|
count: 1
|
|
|
|
|
- containsDocument:
|
|
|
|
|
kind: Job
|
|
|
|
|
apiVersion: batch/v1
|
|
|
|
|
name: gitea-unittests-actions-token-job
|
|
|
|
|
- equal:
|
|
|
|
|
path: spec.template.spec.containers[0].image
|
|
|
|
|
value: "docker.gitea.com/gitea:1.23.6-rootless"
|
|
|
|
|
- it: tag override
|
|
|
|
|
template: templates/job.yaml
|
|
|
|
|
set:
|
|
|
|
|
image.tag: "1.23.7"
|
|
|
|
|
enabled: true
|
|
|
|
|
provisioning:
|
|
|
|
|
enabled: true
|
|
|
|
|
publish:
|
|
|
|
|
tag: "1.29.0"
|
|
|
|
|
persistence:
|
|
|
|
|
enabled: true
|
|
|
|
|
mount: true
|
|
|
|
|
asserts:
|
|
|
|
|
- equal:
|
|
|
|
|
path: spec.template.spec.containers[0].image
|
|
|
|
|
value: "docker.gitea.com/gitea:1.23.7-rootless"
|
|
|
|
|
- equal:
|
|
|
|
|
path: spec.template.spec.containers[1].image
|
|
|
|
|
value: "bitnami/kubectl:1.29.0"
|
|
|
|
|
- it: doesn't renders a Job by default
|
|
|
|
|
template: templates/job.yaml
|
|
|
|
|
asserts:
|
|
|
|
|
- hasDocuments:
|
|
|
|
|
count: 0
|
|
|
|
|
- it: doesn't renders a Job when provisioning is enabled BUT actions are not enabled
|
|
|
|
|
template: templates/job.yaml
|
|
|
|
|
set:
|
|
|
|
|
enabled: false
|
|
|
|
|
provisioning:
|
|
|
|
|
enabled: true
|
|
|
|
|
asserts:
|
|
|
|
|
- hasDocuments:
|
|
|
|
|
count: 0
|
2025-07-23 12:26:46 +02:00
|
|
|
- it: renders a Job with correct wget wait command
|
2025-03-30 23:13:31 +00:00
|
|
|
template: templates/job.yaml
|
|
|
|
|
set:
|
|
|
|
|
enabled: true
|
2025-07-23 15:40:21 +02:00
|
|
|
giteaRootURL: "http://git.example.com:80"
|
2025-03-30 23:13:31 +00:00
|
|
|
provisioning:
|
|
|
|
|
enabled: true
|
|
|
|
|
persistence:
|
|
|
|
|
enabled: true
|
|
|
|
|
mount: true
|
|
|
|
|
asserts:
|
|
|
|
|
- hasDocuments:
|
|
|
|
|
count: 1
|
|
|
|
|
- containsDocument:
|
|
|
|
|
kind: Job
|
|
|
|
|
apiVersion: batch/v1
|
|
|
|
|
name: gitea-unittests-actions-token-job
|
|
|
|
|
- equal:
|
|
|
|
|
path: spec.template.spec.containers[0].image
|
|
|
|
|
value: "docker.gitea.com/gitea:1.23.6-rootless"
|
|
|
|
|
- equal:
|
|
|
|
|
path: spec.template.spec.initContainers[0].command[2]
|
|
|
|
|
value: |
|
2025-07-23 12:26:46 +02:00
|
|
|
echo 'Waiting for gitea...'
|
2025-07-23 15:40:21 +02:00
|
|
|
while ! wget -qO- http://git.example.com:80 > /dev/null; do
|
2025-07-23 12:26:46 +02:00
|
|
|
sleep 2
|
2025-03-30 23:13:31 +00:00
|
|
|
done
|