From d23df4a594e25f24c69b9ffc261522df81dc95ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 23:25:28 +0000 Subject: [PATCH] test: validate diff exit codes in issue-2271 Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/5615c543-f96b-44ed-be25-ca1559ee6ab0 Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com> --- test/integration/test-cases/issue-2271.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/test-cases/issue-2271.sh b/test/integration/test-cases/issue-2271.sh index 5fc9d6f3..0aa58d1f 100755 --- a/test/integration/test-cases/issue-2271.sh +++ b/test/integration/test-cases/issue-2271.sh @@ -40,12 +40,19 @@ assert_lookup_preserved() { local label="$1" local helmfile_path="$2" local output_path="$3" + local code info "Testing diff with ${label} - lookup should preserve value" ${helmfile} -f "${helmfile_path}" diff > "${output_path}" 2>&1 code=$? + if [ $code -ne 0 ] && [ $code -ne 2 ]; then + cat "${output_path}" + rm -rf "${issue_2271_tmp_dir}" + fail "Unexpected error during diff with ${label}" + fi + # Check if the diff contains the preserved value (not "initial-value") if grep -q "preserved-value.*test-preserved-value" "${output_path}"; then info "SUCCESS: lookup function preserved the value with ${label}"