Skip to content

Collapse per-variant test clusters in api-model, rpc, and uuid #2695

@chet

Description

@chet

Three already-migrated crates still carry pockets of one-test-per-variant and self-referential tests the first pass didn't reach. Folding them into carbide-test-support tables puts the covered input space in one readable place and removes boilerplate; a few tests that only exercise a derive or restate a constant can go entirely. Test-only; no behavior change.

Scope

api-model

  • Collapse the five is_power_shelf_* tests (site_explorer/mod.rs) into one value_scenarios! table.
  • Merge build_version_partial_cmp_matches_cmp into the existing build_version_ordering table (machine/upgrade_policy.rs).
  • Drop test_display_matches_debug (controller_outcome.rs) -- Display is defined as Debug::fmt, so it cannot fail -- and the AssignStaticResult PartialEq-derive table (allocation_type.rs).
  • Drop the two IpAddr stdlib-format tests (machine/network.rs).

rpc

  • Collapse the seven per-type MachineCapability* Check tests into one check_cases table (model/machine/capabilities.rs).
  • Drop the two identity_config_try_from_proto_* tests that duplicate exact rows of the existing error-case table (model/tenant.rs).

uuid

  • Merge the parallel RackId / RackProfileId parse + serde tests (rack/mod.rs).
  • Drop the tautological *_conversions tests (transparent newtype: as_str == to_string == as_ref) and the test_db_column_name arm of typed_uuid_tests! (restates a constant against its own definition).

Acceptance

  • Coverage preserved or improved; no production code changes.
  • cargo test green for the three crates; cargo clippy --all-features clean.

Size: S-M

Part of #2692.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions