test: tighten defaultInherit integration assertions

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/d0884e8e-8b1b-456d-8250-dec1566b8a37

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-20 01:48:47 +00:00 committed by GitHub
parent 5aebd49ff6
commit 8b2c2000ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 6 deletions

View File

@ -29,12 +29,21 @@ grep -q "app1" ${issue_2599_tmp}/output.log \
grep -q "app2" ${issue_2599_tmp}/output.log \
|| fail "release app2 should be in output"
# Verify values from common.yaml are inherited
grep -q "common.yaml" ${issue_2599_tmp}/output.log \
|| fail "values from common.yaml should be inherited"
# Verify inherited values and labels per release
sed -n '/name: app1/,/name: app2/p' ${issue_2599_tmp}/output.log > ${issue_2599_tmp}/app1.log
sed -n '/name: app2/,/templates:/p' ${issue_2599_tmp}/output.log > ${issue_2599_tmp}/app2.log
grep -q 'managed: "true"' ${issue_2599_tmp}/app1.log \
|| fail "release app1 should inherit managed label from default template"
grep -q "common.yaml" ${issue_2599_tmp}/app1.log \
|| fail "release app1 should inherit values from common.yaml"
grep -q "common.yaml" ${issue_2599_tmp}/app2.log \
|| fail "release app2 should inherit values from common.yaml"
grep -q 'managed: "true"' ${issue_2599_tmp}/app2.log \
&& fail "release app2 should not inherit managed label due to except"
# Test 2: non-existent template in defaultInherit should fail
info "Running helmfile template with non-existent defaultInherit template"
info "Running helmfile build with non-existent defaultInherit template"
cat > ${issue_2599_tmp}/bad-helmfile.yaml <<EOF
defaultInherit: nonexistent
releases:
@ -42,9 +51,9 @@ releases:
chart: ${dir}/charts/raw
EOF
${helmfile} -f ${issue_2599_tmp}/bad-helmfile.yaml template \
${helmfile} -f ${issue_2599_tmp}/bad-helmfile.yaml build \
> ${issue_2599_tmp}/error.log 2>&1 \
&& fail "helmfile template with non-existent defaultInherit template should fail"
&& fail "helmfile build with non-existent defaultInherit template should fail"
grep -q "inexistent release template" ${issue_2599_tmp}/error.log \
|| fail "error message should mention inexistent release template"