Skip to content

Add property-based coverage for executable candidate resolution #533

Description

@coderabbitai

Summary

Add property-based coverage for executable candidate resolution in test_support/src/netsuke.rs. Validate the selective diagnostic JSON snapshot filter in src/diagnostic_json_tests.rs, or document why finite example coverage is sufficient.

Rationale

candidate_paths combines optional CARGO_TARGET_DIR values, profiles, target triples, and ordered candidates. The current example tests verify selected layouts but do not prove the ordering and candidate-generation invariants across varied valid UTF-8 path components and candidate-presence combinations.

The snapshot filter modifies generated JSON before comparison. A focused test must show that it redacts only the Netsuke generator version and preserves unrelated version fields. If existing finite tests already establish that invariant completely, document the finite-domain rationale in the test or developer documentation.

Required work

  • Add substantive proptest coverage for candidate_paths and/or netsuke_executable_from in test_support/src/netsuke.rs.
  • Generate arbitrary valid UTF-8 roots, profiles, and target triples.
  • Cover an absent and present CARGO_TARGET_DIR.
  • Cover candidate-presence combinations and assert the first existing candidate wins according to the documented lookup order.
  • Assert that the generated candidate list has the intended paths and order for every generated input.
  • Add a focused test for selective diagnostic JSON snapshot filtering in src/diagnostic_json_tests.rs.
  • Alternatively, document and justify why finite coverage fully proves the snapshot-filter behaviour.

Acceptance criteria

  • The test suite contains proptest coverage of candidate generation and lookup ordering.
  • Tests cover primary, profile-fallback, and target-triple-fallback candidate selection under generated inputs.
  • Tests cover missing candidates and preserve diagnostics that list all attempted candidates.
  • A focused test proves that only the Netsuke generator version is redacted, while unrelated version fields remain unchanged; or the codebase contains a clear finite-coverage justification.
  • Run formatting, linting, focused tests, workspace tests, and doctests.

Backlinks

Metadata

Metadata

Assignees

Labels

lowBacklog work, hygiene, or technical debt planned opportunistically, without a strict deadline.testingTest coverage, test infrastructure, and verification tooling work.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions