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
-
Add proptest to Cargo.toml (or use an equivalent property-based testing crate already present).
-
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₃.
-
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.
Testing (Property / Proof)
Context
PR #285 (#285) implements a four-level config precedence order:
The three binary selectors (
cli.configpresent/absent,NETSUKE_CONFIGset/unset,NETSUKE_CONFIG_PATHset/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
Add
proptesttoCargo.toml(or use an equivalent property-based testing crate already present).Implement a property-based test that generates arbitrary combinations of the three selectors and verifies the invariant:
Alternatively, enumerate all 8 states in a regression-prevention matrix (e.g.
rstestparametric cases) with a documented proof assumption explaining why exhaustive property testing is not required.Acceptance criteria
Raised by
Requested by @leynos as a follow-up to #285.