Fix: isolate cli_config_init_default via FLEDGE_CONFIG_DIR (#447 HOME-isolation) - #463
Conversation
The cli_config_init_default integration test invoked `fledge config init` against the developer's real config path, letting it write (or fail on an already-present) ~/.config/fledge/config.toml, and asserted nothing about the outcome. Point it at a fresh TempDir via the FLEDGE_CONFIG_DIR env var (honored by Config::config_path()) so the run is hermetic, and add real assertions: the command succeeds, prints a creation message, and writes config.toml into the isolated dir. Setting the env var on the child process (not the test process) keeps this safe under parallel test execution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016AvsKakjAc3EKN2ztcMfYi
There was a problem hiding this comment.
Code Review
This pull request updates the cli_config_init_default test in tests/main.rs to isolate its execution using a temporary directory and the FLEDGE_CONFIG_DIR environment variable. This prevents the test from modifying the developer's local configuration file during execution. The test now spawns a child process and asserts that the configuration is successfully initialized and written to the isolated directory. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
0xGaspar
left a comment
There was a problem hiding this comment.
Good hardening β the test previously wrote to the developer's real config path and asserted nothing; now it's hermetic via FLEDGE_CONFIG_DIR on the child process (parallel-safe, no serial guard needed) with real assertions on exit status, output, and the written file. Confirming the pre-existing tests/spec.rs failures reproduce on the base branch is the right diligence. LGTM.
There was a problem hiding this comment.
β Corvin says...
_
<(^\ .oO(Caw! ^v^)
|/(\
\(\\
" "\\
"Caw! Found a shiny new spec!"
CI Summary
| Check | Status |
|---|---|
| Dependency Audit | β Passed |
| Integration (3 OS) | β Passed |
| Lint (fmt + clippy) | β Passed |
| Spec Validation | β Passed |
| Tests (3 OS) | β Passed |
Powered by corvid-pet
Summary
cli_config_init_default(tests/main.rs) previously ranfledge config initagainst the developer's real config path β it could write a real~/.config/fledge/config.toml(or fail if one already existed) and asserted nothing (let _ = output.status;).TempDirvia theFLEDGE_CONFIG_DIRenv var (honored byConfig::config_path()in src/config.rs), then add real assertions β the command succeeds, prints a "Created" message, and actually writesconfig.tomlinto the isolated dir.Scope notes
cli_config_set_and_get_roundtrip,cli_config_add_remove_list_key) already isolate viaFLEDGE_CONFIG_DIR; the unknown-key tests fail before saving so they never write. Thesrc/config.rsunit tests use in-memory TOML or explicitsave_to(tempdir), so none touch the real path.Test Plan
cargo fmt --checkcleancargo clippy --bin fledge --tests -- -D warningscleancargo test --lib/--bin fledge(897 pass) and all integration binaries except spec pass;cli_config_init_defaultpassestests/spec.rsspec-check failures are pre-existing and environmental (installedspecsyncv4.6.0 emits a differentspec check --jsonenvelope) β they reproduce on the base branch viagit stashand are unrelated to this changeπ€ Generated with Claude Code
https://claude.ai/code/session_016AvsKakjAc3EKN2ztcMfYi
Closes #447