Add property tests for CLI merge invariants (#317)#368
Conversation
The layered configuration merge's invariants — precedence ordering, list-appending, and cross-field validation — were exercised only by hand-picked examples. Add generative coverage at the `CliConfig::merge_from_layers` boundary: - `jobs_follow_layer_precedence`: for any combination of present and absent layers, the highest-precedence layer supplying `jobs` wins (CLI over environment over file); - `append_lists_concatenate_in_layer_order`: append-merged lists concatenate file, environment, then CLI values for arbitrary lists, and file-supplied build targets survive intact; - `theme_no_emoji_validation_matches_documented_rules` and `spinner_progress_validation_matches_documented_rules`: across the full enum domains, validation fires for exactly the documented conflicting pairs; - `jobs_bounds_validation_matches_documented_rules`: `jobs` is accepted exactly within `1..=64`. `proptest` was already a dev-dependency.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideAdds proptest-based property tests for CLI configuration merge invariants at the CliConfig::merge_from_layers boundary, covering layer precedence, list appending behavior, and validation rule correctness for multiple configuration fields. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
Closes #317
Adds
proptestcoverage for the merge invariants introduced by PR #273, at theCliConfig::merge_from_layersboundary (no filesystem or environment mutation, so the cases run fast and in parallel):jobswins (CLI > env > file > defaults).cmds.build.targetssurvive the merge intact.theme×no_emojiandspinner_mode×progressdomains, validation fires for exactly the documented conflicting pairs;jobsis accepted exactly within1..=64.Validation
make check-fmt/make lint/make test— pass (37 suites; 5 new property tests green)🤖 Generated with Claude Code
Summary by Sourcery
Add property-based tests to verify CLI configuration merge invariants at the CliConfig::merge_from_layers boundary.
Tests: