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>
This commit is contained in:
parent
1c081a3a43
commit
d23df4a594
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue