fix tests

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-02-05 07:58:31 +08:00 committed by yxxhero
parent 40a4239d26
commit 3b998a30ec
2 changed files with 32 additions and 2 deletions

View File

@ -4,12 +4,17 @@ v1_subhelmfile_multi_bases_with_array_values_output_dir="${cases_dir}/v1-subhelm
yaml_overwrite_tmp=$(mktemp -d)
yaml_overwrite_reverse=${yaml_overwrite_tmp}/helmfile_template_result
v1_subhelmfile_multi_bases_with_array_values_output_file=result
if [[ $EXTRA_HELMFILE_FLAGS == *--enable-live-output* ]]; then
v1_subhelmfile_multi_bases_with_array_values_output_file=${v1_subhelmfile_multi_bases_with_array_values_output_dir}/result-live
fi
test_start "v1 subhelmfile multi bases with array values"
info "Comparing v1 subhelmfile multi bases with array values output ${yaml_overwrite_reverse} with ${v1_subhelmfile_multi_bases_with_array_values_output_dir}/result"
info "Comparing v1 subhelmfile multi bases with array values output ${yaml_overwrite_reverse} with ${v1_subhelmfile_multi_bases_with_array_values_output_file}"
for i in $(seq 10); do
info "Comparing build/v1-subhelmfile-multi-bases-with-array-values #$i"
${helmfile} -f ${v1_subhelmfile_multi_bases_with_array_values_input_dir}/helmfile.yaml.gotmpl template -e dev &> ${yaml_overwrite_reverse} || fail "\"helmfile template\" shouldn't fail"
diff -u ${v1_subhelmfile_multi_bases_with_array_values_output_dir}/result ${yaml_overwrite_reverse} || fail "\"helmfile template\" should be consistent"
diff -u ${v1_subhelmfile_multi_bases_with_array_values_output_file} ${yaml_overwrite_reverse} || fail "\"helmfile template\" should be consistent"
echo code=$?
done
test_pass "v1 subhelmfile multi bases with array values"

View File

@ -0,0 +1,25 @@
Live output is enabled
Adding repo incubator https://charts.helm.sh/incubator/
"incubator" has been added to your repositories
Templating release=helmfile-test, chart=incubator/raw
---
# Source: raw/templates/resources.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
app: raw
chart: raw-0.1.0
heritage: Helm
release: helmfile-test
name: test
spec:
containers:
- command:
- /bin/sh
- -c
- env
image: registry.k8s.io/busybox
name: test-container