Description
The configuration loading system needs more comprehensive testing to ensure that CLI arguments properly override existing configuration values without replacing present values with empty values.
Location
crates/wash/src/config.rs:153 in the load_config function
Current Behavior
The load_config function implements a hierarchical configuration system with this precedence:
- Default values
- Global config (
~/.wash/config.json)
- Local project config (
.wash/config.json)
- Environment variables (
WASH_ prefix)
- Command line arguments (highest priority)
However, there's incomplete testing to ensure CLI args behave correctly when overriding existing configuration.
Problem
The current implementation may have issues where:
- CLI args with empty/default values might replace valid configured values
- Partial CLI config objects might override entire config sections
- Edge cases in the merge behavior aren't properly tested
Proposed Solution
Add comprehensive test coverage for:
- Selective override testing: Verify CLI args only override specified fields
- Empty value handling: Ensure empty CLI values don't replace valid config values
- Nested config merging: Test deep merging behavior for complex config structures
- Edge cases: Test various combinations of config sources
Example Test Cases
#[test]
fn test_cli_args_selective_override() {
// Verify that setting only one CLI arg doesn't clear other configured values
}
#[test]
fn test_cli_args_empty_values() {
// Verify empty CLI values don't override existing valid config
}
Context
This is critical for ensuring users can rely on CLI arguments working as expected without inadvertently breaking their saved configuration.
Description
The configuration loading system needs more comprehensive testing to ensure that CLI arguments properly override existing configuration values without replacing present values with empty values.
Location
crates/wash/src/config.rs:153in theload_configfunctionCurrent Behavior
The
load_configfunction implements a hierarchical configuration system with this precedence:~/.wash/config.json).wash/config.json)WASH_prefix)However, there's incomplete testing to ensure CLI args behave correctly when overriding existing configuration.
Problem
The current implementation may have issues where:
Proposed Solution
Add comprehensive test coverage for:
Example Test Cases
Context
This is critical for ensuring users can rely on CLI arguments working as expected without inadvertently breaking their saved configuration.