Fix unittests (#434)

Unclear why it only appeared now and not earlier.

Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/434
Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
This commit is contained in:
pat-s 2023-04-14 14:45:37 +08:00 committed by pat-s
parent a9779c9724
commit 9f0b65f386
4 changed files with 14 additions and 3 deletions

View file

@ -28,7 +28,7 @@ steps:
image: alpine:3.17 image: alpine:3.17
commands: commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash
- helm plugin install https://github.com/helm-unittest/helm-unittest - helm plugin install --version 0.3.1 https://github.com/helm-unittest/helm-unittest
- helm dependency update - helm dependency update
- make unittests - make unittests

View file

@ -8,6 +8,10 @@ tests:
- it: runs gpg in batch mode - it: runs gpg in batch mode
set: set:
signing.enabled: true signing.enabled: true
signing.privateKey: |-
-----BEGIN PGP PRIVATE KEY BLOCK-----
{placeholder}
-----END PGP PRIVATE KEY BLOCK-----
asserts: asserts:
- equal: - equal:
path: stringData["configure_gpg_environment.sh"] path: stringData["configure_gpg_environment.sh"]
@ -38,6 +42,10 @@ tests:
- it: adds gpg script block for enabled signing - it: adds gpg script block for enabled signing
set: set:
signing.enabled: true signing.enabled: true
signing.privateKey: |-
-----BEGIN PGP PRIVATE KEY BLOCK-----
{placeholder}
-----END PGP PRIVATE KEY BLOCK-----
asserts: asserts:
- equal: - equal:
path: stringData["init_directory_structure.sh"] path: stringData["init_directory_structure.sh"]

View file

@ -17,9 +17,9 @@ tests:
- it: skips gpg env in `init-directories` init container - it: skips gpg env in `init-directories` init container
template: templates/gitea/statefulset.yaml template: templates/gitea/statefulset.yaml
set: set:
signing.enabled: true signing.enabled: false
asserts: asserts:
- contains: - notContains:
path: spec.template.spec.initContainers[0].env path: spec.template.spec.initContainers[0].env
content: content:
name: GNUPGHOME name: GNUPGHOME

View file

@ -42,6 +42,7 @@ tests:
template: templates/gitea/statefulset.yaml template: templates/gitea/statefulset.yaml
set: set:
signing.enabled: true signing.enabled: true
signing.existingSecret: "custom-gpg-secret"
asserts: asserts:
- contains: - contains:
path: spec.template.spec.initContainers[0].env path: spec.template.spec.initContainers[0].env
@ -52,6 +53,7 @@ tests:
template: templates/gitea/statefulset.yaml template: templates/gitea/statefulset.yaml
set: set:
signing.enabled: true signing.enabled: true
signing.existingSecret: "custom-gpg-secret"
asserts: asserts:
- contains: - contains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
@ -63,6 +65,7 @@ tests:
set: set:
signing: signing:
enabled: true enabled: true
existingSecret: "gitea-unittests-gpg-key"
asserts: asserts:
- contains: - contains:
path: spec.template.spec.volumes path: spec.template.spec.volumes