Skip to content

fix(tests): isolate CLAW_CONFIG_HOME in resumed_status JSON test#2992

Merged
code-yeongyu merged 1 commit intomainfrom
fix/resumed-status-test-config-isolation
May 4, 2026
Merged

fix(tests): isolate CLAW_CONFIG_HOME in resumed_status JSON test#2992
code-yeongyu merged 1 commit intomainfrom
fix/resumed-status-test-config-isolation

Conversation

@code-yeongyu
Copy link
Copy Markdown
Collaborator

Problem

resumed_status_command_emits_structured_json_when_requested was reading the real ~/.claw/settings.json on developer machines, causing:

assert_eq!(parsed["workspace"]["loaded_config_files"].as_u64(), Some(0))
// fails with: left: Some(1) right: Some(0)

This was a pre-existing main failure blocking PRs #2973, #2988, #2990 from showing clean CI.

Root Cause

Unlike other tests (e.g. resumed_config_command_loads_settings_files), this test did not pass an isolated CLAW_CONFIG_HOME env var to run_claw. So claw fell back to HOME and loaded whatever ~/.claw/settings.json the developer had present.

Fix

Create a temp config-home dir and pass it as CLAW_CONFIG_HOME via run_claw_with_env. This gives the assertion a clean 0-file baseline, consistent with all other test isolation patterns.

Test

cargo test -p rusty-claude-cli -- --test-thread=1
# all 12 tests pass

Closes ROADMAP #65.

resumed_status_command_emits_structured_json_when_requested was reading
the real ~/.claw/settings.json, causing loaded_config_files to be 1
instead of the expected 0 on machines with user config present.

Root cause: unlike other tests (e.g. resumed_config_command_loads_settings_files),
this test did not pass an isolated CLAW_CONFIG_HOME env var to run_claw,
so claw fell back to the real HOME and loaded the developer's settings file.

Fix: create a temp config-home dir and pass it as CLAW_CONFIG_HOME via
run_claw_with_env. This gives the assertion a clean 0-file baseline.

Unblocks PRs #2973, #2988, #2990 which all failed this same test on main.

Ref: ROADMAP #65
@code-yeongyu code-yeongyu merged commit 9b97c4d into main May 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant