Skip to content

Add property-based tests (proptest) exhaustively verifying config-precedence invariant across all 8 selector combinations #291

@coderabbitai

Description

@coderabbitai

Testing (Property / Proof)

Context

PR #285 (#285) implements a four-level config precedence order:

--config  >  NETSUKE_CONFIG  >  NETSUKE_CONFIG_PATH  >  automatic discovery

The three binary selectors (cli.config present/absent, NETSUKE_CONFIG set/unset, NETSUKE_CONFIG_PATH set/unset) produce 8 combinations. The current test suite covers 5 of these states with named integration tests. The remaining 3 are untested, and no framework enforces the precedence invariant exhaustively across all combinations.

Required work

  1. Add proptest to Cargo.toml (or use an equivalent property-based testing crate already present).

  2. Implement a property-based test that generates arbitrary combinations of the three selectors and verifies the invariant:

    When selector S₁ is present, the resolved config is always the one selected by S₁, regardless of the values of lower-priority selectors S₂ and S₃.

  3. Alternatively, enumerate all 8 states in a regression-prevention matrix (e.g. rstest parametric cases) with a documented proof assumption explaining why exhaustive property testing is not required.

Acceptance criteria

  • All 8 selector combinations are covered, either by generated or enumerated cases.
  • The precedence invariant is expressed as a testable predicate, not just as prose.

Raised by

Requested by @leynos as a follow-up to #285.

Metadata

Metadata

Assignees

Labels

lowAin't annoying anyone but the QA department

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions