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:
parent
f6fde6780b
commit
7df4750f22
1 changed files with 4 additions and 4 deletions
|
|
@ -596,6 +596,10 @@ EOF
|
||||||
@test "reset_session prevents issue #91 scenario (stale completion indicators)" {
|
@test "reset_session prevents issue #91 scenario (stale completion indicators)" {
|
||||||
# Issue #91: Ralph exits immediately when stale completion_indicators exist
|
# 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:
|
# Simulate the issue scenario:
|
||||||
# 1. Previous session ended with completion_indicators: [1,2]
|
# 1. Previous session ended with completion_indicators: [1,2]
|
||||||
# 2. Previous session had EXIT_SIGNAL: true
|
# 2. Previous session had EXIT_SIGNAL: true
|
||||||
|
|
@ -609,10 +613,6 @@ EOF
|
||||||
local exit_signal=$(jq -r '.analysis.exit_signal' "$RESPONSE_ANALYSIS_FILE")
|
local exit_signal=$(jq -r '.analysis.exit_signal' "$RESPONSE_ANALYSIS_FILE")
|
||||||
[[ "$exit_signal" == "true" ]]
|
[[ "$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
|
# Define reset_session with the fix
|
||||||
reset_session() {
|
reset_session() {
|
||||||
local reason=${1:-"manual_reset"}
|
local reason=${1:-"manual_reset"}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue