Skip to content
Snippets Groups Projects
Commit 9dba6154 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3328 new helm unittest framework

parent 53890ab6
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,11 @@ release:
namespace: sh-test-test
templates:
- templates/api-password-secret.yaml
set:
ozgcloud:
keycloak:
api:
password: testPassword
tests:
- it: test api secret kind
asserts:
......@@ -13,7 +18,7 @@ tests:
asserts:
- equal:
path: stringData.password
value: geheim
value: testPassword
- it: should use Keycloak User Operator
set:
sso:
......
......@@ -27,11 +27,16 @@ release:
name: user-manager
templates:
- templates/deployment.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso:
serverUrl: https://sso.test.by.ozg-cloud.local
baseUrl: test.company.local
tests:
- it: validate keycloak configuration values
template: deployment.yaml
release:
namespace: sh-helm-test
asserts:
- contains:
path: spec.template.spec.containers[0].env
......@@ -51,17 +56,17 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: OZGCLOUD_KEYCLOAK_API_REALM
value: sh-helm-test
value: by-helm-dev
- contains:
path: spec.template.spec.containers[0].env
content:
name: QUARKUS_OIDC_AUTH_SERVER_URL
value: https://sso.test.sh.ozg-cloud.de/realms/sh-helm-test
value: https://sso.test.by.ozg-cloud.local/realms/by-helm-dev
- contains:
path: spec.template.spec.containers[0].env
content:
name: KEYCLOAK_URL
value: https://sso.test.sh.ozg-cloud.de
value: https://sso.test.by.ozg-cloud.local
- contains:
path: spec.template.spec.containers[0].env
content:
......@@ -69,12 +74,10 @@ tests:
value: alfa
- it: should set keycloak client name
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso:
client_name: alfa
serverUrl: https://sso.company.local
asserts:
- contains:
path: spec.template.spec.containers[0].env
......@@ -83,9 +86,6 @@ tests:
value: alfa
- it: sso.serverurl with https
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso.serverUrl: https://sso.test.by.ozg-cloud.de
asserts:
......@@ -93,16 +93,13 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: QUARKUS_OIDC_AUTH_SERVER_URL
value: https://sso.test.by.ozg-cloud.de/realms/sh-helm-test
value: https://sso.test.by.ozg-cloud.de/realms/by-helm-dev
- contains:
path: spec.template.spec.containers[0].env
content:
name: KEYCLOAK_URL
value: https://sso.test.by.ozg-cloud.de
- it: sso.serverurl without https
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso.serverUrl: sso.test.by.ozg-cloud.de
asserts:
......@@ -110,20 +107,19 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: QUARKUS_OIDC_AUTH_SERVER_URL
value: https://sso.test.by.ozg-cloud.de/realms/sh-helm-test
value: https://sso.test.by.ozg-cloud.de/realms/by-helm-dev
- contains:
path: spec.template.spec.containers[0].env
content:
name: KEYCLOAK_URL
value: https://sso.test.by.ozg-cloud.de
- it: should use Keycloak User Operator
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso:
api_user:
name: -userManager-ApiUser
serverUrl: https://sso.company.local
asserts:
- contains:
path: spec.template.spec.containers[0].env
......
......@@ -27,6 +27,13 @@ release:
name: user-manager
templates:
- templates/deployment.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso.serverUrl: https://sso.company.local
baseUrl: test.company.local
tests:
- it: should reference mongodb connectionString for user-manager
set:
......
......@@ -27,6 +27,13 @@ release:
name: user-manager
templates:
- templates/deployment.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso.serverUrl: https://sso.company.local
baseUrl: test.company.local
tests:
- it: test resources for prod environment
release:
......
......@@ -27,6 +27,13 @@ release:
name: user-manager
templates:
- templates/deployment.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso.serverUrl: https://sso.company.local
baseUrl: test.company.local
tests:
- it: validate keycloak configuration values
template: deployment.yaml
......@@ -37,4 +44,4 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: OZGCLOUD_USER_MANAGER_URL
value: https://helm-user-manager.test.sh.ozg-cloud.de
\ No newline at end of file
value: https://helm-user-manager.test.company.local
\ No newline at end of file
......@@ -28,6 +28,13 @@ release:
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso.serverUrl: https://sso.company.local
baseUrl: test.company.local
tests:
- it: check default values
asserts:
......
......@@ -30,39 +30,47 @@ templates:
- templates/deployment.yaml
- templates/service.yaml
- templates/service_monitor.yaml
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
sso:
serverUrl: https://sso.company.local
baseUrl: test.sh.ozg-cloud.local
tests:
- it: check default labels
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/instance]
path: metadata.labels["app.kubernetes.io/instance"]
value: user-manager
- equal:
path: metadata.labels.[app.kubernetes.io/name]
path: metadata.labels["app.kubernetes.io/name"]
value: user-manager
- equal:
path: metadata.labels.[app.kubernetes.io/part-of]
path: metadata.labels["app.kubernetes.io/part-of"]
value: ozgcloud
- equal:
path: metadata.labels.[app.kubernetes.io/namespace]
path: metadata.labels["app.kubernetes.io/namespace"]
value: sh-helm-test
- it: check component label for deployment
templates:
- templates/deployment.yaml
asserts:
- equal:
path: spec.template.metadata.labels.[component]
path: spec.template.metadata.labels["component"]
value: user-manager
- it: check component label for service
templates:
- templates/service.yaml
asserts:
- equal:
path: metadata.labels.[component]
path: metadata.labels["component"]
value: user-manager-service
- it: check component label for service monitor
templates:
- templates/service_monitor.yaml
asserts:
- equal:
path: metadata.labels.[component]
path: metadata.labels["component"]
value: user-manager-service-monitor
......@@ -80,6 +80,9 @@ tests:
- it: check user sync period set
set:
ozgcloud:
bundesland: by
bezeichner: helm
environment: dev
usersync:
period: "6h"
asserts:
......
......@@ -85,6 +85,8 @@ tests:
- it: add ingress rule by values
set:
networkPolicy:
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-namespace-dns
additionalIngressConfig:
- podSelector:
matchLabels:
......@@ -112,6 +114,8 @@ tests:
set:
networkPolicy:
disabled: false
ssoPublicIp: 51.89.117.53/32
dnsServerNamespace: test-namespace-dns
asserts:
- hasDocuments:
count: 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment