Skip to content

Property-based tests for CLI merge precedence and validation invariants using proptest #317

Description

@coderabbitai

Summary

The CLI configuration merge pipeline introduced in #273 establishes a number of invariants (layer precedence ordering, list-appending semantics, cross-field validation rules) that are currently exercised only through example-based rstest cases. Property-based testing would provide much stronger confidence that these invariants hold across arbitrary inputs.

Context

PR #273 introduced src/cli/merge.rs and src/cli/config.rs with the following invariants:

  • Merge precedence: defaults → file layers → environment → CLI overrides
  • List-appending: cmds.build.targets is appended in discovery order
  • Validation rules: theme/no_emoji compatibility, spinner_mode/progress compatibility, output_format restriction

proptest is already available in the workspace. The current test suite in tests/cli_tests/merge.rs uses hand-picked examples only.

Proposed work

  • Generate arbitrary CliConfig layer values using proptest strategies
  • Verify that merge ordering is consistently respected (e.g., a CLI value always wins over a file value for the same field)
  • Verify that validation rules fire correctly across the full domain of enum combinations
  • Verify list-appending semantics under arbitrary target lists

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

mediumRoadmap items to schedule within the current quarter. Clear scope, normal review cycles.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions