From 669e213de29c4aeb18f1ce99031fd4218f8356c3 Mon Sep 17 00:00:00 2001 From: S Code Man <30977678+scodeman@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:20:28 +0000 Subject: [PATCH] chore: add test Signed-off-by: GitHub --- test/integration/run.sh | 5 ++++- test/integration/test-cases/issue-1893.sh | 8 ++++++++ .../test-cases/issue-1893/input/helmfile.yaml | 20 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/integration/test-cases/issue-1893.sh create mode 100644 test/integration/test-cases/issue-1893/input/helmfile.yaml diff --git a/test/integration/run.sh b/test/integration/run.sh index b1548856..f3d9bb5f 100755 --- a/test/integration/run.sh +++ b/test/integration/run.sh @@ -28,6 +28,7 @@ export HELM_HOME="${HELM_DATA_HOME}" export HELM_PLUGINS="${HELM_DATA_HOME}/plugins" export HELM_CONFIG_HOME="${helm_dir}/config" HELM_DIFF_VERSION="${HELM_DIFF_VERSION:-3.9.14}" +HELM_GIT_VERSION="${HELM_GIT_VERSION:-1.3.0}" HELM_SECRETS_VERSION="${HELM_SECRETS_VERSION:-3.15.0}" export GNUPGHOME="${PWD}/${dir}/.gnupg" export SOPS_PGP_FP="B2D6D7BBEC03B2E66571C8C00AD18E16CFDEF700" @@ -70,7 +71,8 @@ set -e trap cleanup EXIT info "Using namespace: ${test_ns}" info "Using Helm version:" $(${helm} version --short | grep -o 'v[0-9.]\+') -${helm} plugin ls | grep diff || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION} +${helm} plugin ls | grep "^diff" || ${helm} plugin install https://github.com/databus23/helm-diff --version v${HELM_DIFF_VERSION} +${helm} plugin ls | grep "^helm-git" || ${helm} plugin install https://github.com/aslafy-z/helm-git --version v${HELM_GIT_VERSION} info "Using Kustomize version: $(kustomize version --short | grep -o 'v[0-9.]\+')" ${kubectl} get namespace ${test_ns} &> /dev/null && warn "Namespace ${test_ns} exists, from a previous test run?" ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${test_ns}" @@ -98,6 +100,7 @@ ${kubectl} create namespace ${test_ns} || fail "Could not create namespace ${tes . ${dir}/test-cases/deps-kustomization-i-1402.sh . ${dir}/test-cases/hcl-secrets.sh . ${dir}/test-cases/issue-1749.sh +. ${dir}/test-cases/issue-1893.sh # ALL DONE ----------------------------------------------------------------------------------------------------------- diff --git a/test/integration/test-cases/issue-1893.sh b/test/integration/test-cases/issue-1893.sh new file mode 100644 index 00000000..0306275b --- /dev/null +++ b/test/integration/test-cases/issue-1893.sh @@ -0,0 +1,8 @@ +issue_1893_input_dir="${cases_dir}/issue-1893/input" +helmfile_real="$(pwd)/${helmfile}" + +test_start "issue 1893 helmfile template" +cd "${issue_1893_input_dir}" +${helmfile_real} template || fail "\"issue 1893 helmfile template shouldn't fail" +cd - +test_pass "issue 1893 helmfile template" \ No newline at end of file diff --git a/test/integration/test-cases/issue-1893/input/helmfile.yaml b/test/integration/test-cases/issue-1893/input/helmfile.yaml new file mode 100644 index 00000000..f52eaef8 --- /dev/null +++ b/test/integration/test-cases/issue-1893/input/helmfile.yaml @@ -0,0 +1,20 @@ +--- +repositories: +- name: chartify-testdata + url: git+https://github.com/helmfile/chartify@testdata/charts/importvalues?ref=master + +releases: +- name: importvalues + chart: chartify-testdata/importvalues + version: 0.1.0 + transformers: + - apiVersion: builtin + kind: ValueAddTransformer + metadata: + name: add-annotation-issue + targets: + - fieldPath: metadata/annotations/issue + selector: + kind: ConfigMap + name: importvalues-imported-values + value: "1893" \ No newline at end of file