Compare commits

...
Author SHA1 Message Date
jknapp 935b02eae4 Merge pull request 'tests: fix SC2034 + pipefail hazard in lsphp-src-upload-progress test' (#47) from fix/shellcheck-upload-progress-test into trunk
[skip ci] Fix shellcheck SC2034 and pipefail SIGPIPE pattern in lsphp upload-progress test
2026-11-19 20:13:37 +00:00
shadowdaoandClaude Sonnet 5.5 be8723c468 tests: fix SC2034 and early-exit pipeline in lsphp-src-upload-progress test
Shell-Checks failed on SC2034 (SRC only used inside eval), and the
lsphp-info-probe structural scan flagged the grep|grep|head pipeline
(pipefail SIGPIPE hazard) in the same new test. Replace with a read loop;
export SRC. No product script changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 12:01:11 -08:00
jknapp a43a755b9d Merge pull request #46 PHP 8.6 for cac/cac-fpm [skip ci]
[skip ci]
2026-11-19 19:38:17 +00:00
@@ -15,9 +15,16 @@ cat >"$T/session.c" <<'EOT'
"0", ZEND_INI_PERDIR, OnUpdateBool, rfc1867_cleanup, php_ps_globals, ps_globals) "0", ZEND_INI_PERDIR, OnUpdateBool, rfc1867_cleanup, php_ps_globals, ps_globals)
EOT EOT
## Run the exact sed expression from the script. ## Run the exact sed expression from the script.
SEDLINE=$(grep -F "session\\.upload_progress\\.enabled" "$S" | grep '^ *sed -i' | head -n1) ## Plain loop, not a grep|grep|head pipeline: an early-exit reader under pipefail
## can SIGPIPE its writer (see lsphp-info-probe.test.sh structural scan).
SEDLINE=""
while IFS= read -r line; do
case "$line" in *'session\.upload_progress\.enabled'*) ;; *) continue ;; esac
case "$line" in ' '*'sed -i'*|'sed -i'*) SEDLINE="$line"; break ;; esac
done <"$S"
[ -n "$SEDLINE" ] || { echo "FAIL: sed line not found in script"; exit 1; } [ -n "$SEDLINE" ] || { echo "FAIL: sed line not found in script"; exit 1; }
SRC="$T"; sed() { command sed "$@"; } export SRC="$T" # referenced by the eval'd sed line
sed() { command sed "$@"; }
eval "${SEDLINE//\$SRC\/ext\/session\/session.c/$T/session.c}" eval "${SEDLINE//\$SRC\/ext\/session\/session.c/$T/session.c}"
chk "enabled flipped to 1" "$(grep -A1 'upload_progress.enabled' "$T/session.c" | grep -c '"1"')" 1 chk "enabled flipped to 1" "$(grep -A1 'upload_progress.enabled' "$T/session.c" | grep -c '"1"')" 1
chk "cleanup untouched" "$(grep -A1 'upload_progress.cleanup' "$T/session.c" | grep -c '"0"')" 1 chk "cleanup untouched" "$(grep -A1 'upload_progress.cleanup' "$T/session.c" | grep -c '"0"')" 1