From 895f68ab9ae73fc555a38dc0cbdcaeda6ff5b3b4 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 11 Jan 2024 20:33:20 +0100 Subject: [PATCH] OZG-3328 use new helm unittest framework for xta adapter --- xta-adapter/run_helm_test.sh | 2 +- .../src/test/helm/image_pull_secret_test.yaml | 2 +- .../src/test/helm/xta-root-ca-secret-test.yaml | 2 +- .../helm/xta_adapter_cronjob_dummy_probes_test.yaml | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xta-adapter/run_helm_test.sh b/xta-adapter/run_helm_test.sh index 9e10b8f0e..8cfc42013 100755 --- a/xta-adapter/run_helm_test.sh +++ b/xta-adapter/run_helm_test.sh @@ -4,4 +4,4 @@ set -e helm template ./src/main/helm/ -f src/main/helm/test-values.yaml helm lint -f src/test/helm/values/unit-values.yaml ./src/main/helm/ -cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/helm/values/unit-values.yaml' . \ No newline at end of file +cd src/main/helm && helm unittest -f '../../test/helm/*.yaml' -v '../../test/helm/values/unit-values.yaml' . \ No newline at end of file diff --git a/xta-adapter/src/test/helm/image_pull_secret_test.yaml b/xta-adapter/src/test/helm/image_pull_secret_test.yaml index 80bffcc06..1db60649f 100644 --- a/xta-adapter/src/test/helm/image_pull_secret_test.yaml +++ b/xta-adapter/src/test/helm/image_pull_secret_test.yaml @@ -49,7 +49,7 @@ tests: path: metadata.namespace value: helm-test - isNotEmpty: - path: data.[.dockerconfigjson] + path: data[".dockerconfigjson"] - it: should not create image pull secret set: diff --git a/xta-adapter/src/test/helm/xta-root-ca-secret-test.yaml b/xta-adapter/src/test/helm/xta-root-ca-secret-test.yaml index 3ca7b4a14..c3861ba54 100644 --- a/xta-adapter/src/test/helm/xta-root-ca-secret-test.yaml +++ b/xta-adapter/src/test/helm/xta-root-ca-secret-test.yaml @@ -44,6 +44,6 @@ tests: path: metadata.namespace value: helm-test - equal: - path: data.[ca.crt] + path: data["ca.crt"] value: Z2VoZWltCg== diff --git a/xta-adapter/src/test/helm/xta_adapter_cronjob_dummy_probes_test.yaml b/xta-adapter/src/test/helm/xta_adapter_cronjob_dummy_probes_test.yaml index e34455f65..0a3ef9a96 100644 --- a/xta-adapter/src/test/helm/xta_adapter_cronjob_dummy_probes_test.yaml +++ b/xta-adapter/src/test/helm/xta_adapter_cronjob_dummy_probes_test.yaml @@ -32,17 +32,17 @@ tests: - it: check dummy livenessProbe default disabled template: xta_adapter_cronjob.yaml asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].livenessProbe - it: check dummy startupProbe default disabled template: xta_adapter_cronjob.yaml asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].startupProbe - it: check dummy readynessProbe default disabled template: xta_adapter_cronjob.yaml asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].readinessProbe - it: check dummy livenessProbe disabled @@ -50,21 +50,21 @@ tests: set: dummyProbesEnabled: false asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].livenessProbe - it: check dummy startupProbe disabled template: xta_adapter_cronjob.yaml set: dummyProbesEnabled: false asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].startupProbe - it: check dummy readynessProbe disabled template: xta_adapter_cronjob.yaml set: dummyProbesEnabled: false asserts: - - isEmpty: + - notExists: path: spec.jobTemplate.spec.template.spec.containers[0].readinessProbe -- GitLab