Skip to content

Collapse per-variant test clusters in admin-cli, libmlx, and ib-fabric #2696

@chet

Description

@chet

Three more already-migrated crates carry one-function-per-variant clusters and a few tests that assert nothing. Collapsing the clusters into tables makes each decision matrix readable at a glance; the no-assertion and stdlib tests can go. Test-only; no behavior change.

Scope

ib-fabric

  • Collapse the 12 should_track_port_as_down_* functions into one table (lib.rs); fold the three ib_port_down_alert_* tests into a projection table.

admin-cli

  • Collapse the six dpu_mode per-variant parse tests into one scenarios! table (expected_machines/tests.rs).
  • Rewrite health_override_templates_value_enum (machine/tests.rs) so it yields the variant rather than mapping a string back to itself, and so a newly-added variant can't slip silently past the _ => unreachable!() arm.
  • Merge boot_override parse_get / parse_clear; drop the no-assertion routing tests (firmware / dpu parse_*) and the two assert_dispatch::<T>() compile-checks (cfg/dispatch.rs).

libmlx

  • Collapse the four near-duplicate traits_tests.rs function pairs.
  • Delete the five exec_options_tests.rs::advanced_tests::test_sample*_config functions (they set builder fields then re-assert them).
  • Remove the construction-then-drop "creation" / "default" tests and the str::contains / Command-debug stdlib tests (tests/lockdown/, tests/runner/).

Acceptance

  • Coverage preserved or improved; the value_enum rewrite fails when a variant is added without a row.
  • 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