fix(test): ensure RESPONSE_ANALYSIS_FILE is set before use in test 199 (#133)

Move variable exports before first use in the #91 regression test to
prevent "No such file or directory" failures in CI environments where
setup() state may not persist.

Co-authored-by: Test User <test@example.com>
This commit is contained in:
Frank Bria 2026-01-27 09:32:47 -07:00 committed by GitHub
parent f6fde6780b
commit 7df4750f22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -596,6 +596,10 @@ EOF
@test "reset_session prevents issue #91 scenario (stale completion indicators)" {
# Issue #91: Ralph exits immediately when stale completion_indicators exist
# Ensure variables are set before use (defensive against env differences)
export RESPONSE_ANALYSIS_FILE="$RALPH_DIR/.response_analysis"
export RALPH_SESSION_HISTORY_FILE="$RALPH_DIR/.ralph_session_history"
# Simulate the issue scenario:
# 1. Previous session ended with completion_indicators: [1,2]
# 2. Previous session had EXIT_SIGNAL: true
@ -609,10 +613,6 @@ EOF
local exit_signal=$(jq -r '.analysis.exit_signal' "$RESPONSE_ANALYSIS_FILE")
[[ "$exit_signal" == "true" ]]
# Now simulate user running --reset-session (which should clear these files)
export RALPH_SESSION_HISTORY_FILE="$RALPH_DIR/.ralph_session_history"
export RESPONSE_ANALYSIS_FILE="$RALPH_DIR/.response_analysis"
# Define reset_session with the fix
reset_session() {
local reason=${1:-"manual_reset"}