From 7df4750f22280ce3222203c8fdcafe36f961dc99 Mon Sep 17 00:00:00 2001 From: Frank Bria Date: Tue, 27 Jan 2026 09:32:47 -0700 Subject: [PATCH] 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 --- tests/unit/test_session_continuity.bats | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_session_continuity.bats b/tests/unit/test_session_continuity.bats index e411ab0..4e0c710 100644 --- a/tests/unit/test_session_continuity.bats +++ b/tests/unit/test_session_continuity.bats @@ -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"}