Skip to content

Adopt carbide-test-support across the agent crate's parser tests #2729

Description

@chet

The agent crate doesn't use the table helper at all, yet it's full of per-case parser/predicate clusters -- the largest single adoption target in Wave 2. This adopts carbide-test-support across its parser tests and closes a few coverage gaps the per-case style left open.

Scope

Adopt the helper (collapse per-case clusters):

  • health/bgp.rs -- the 8 verify_bgp_summary tests (each rebuilds the same scaffold) -> one check_cases table keyed on a named struct ({ json, host_routes, route_servers, expected_alerts }).
  • nvue.rs -- split_prefixes_by_family (7 near-identical) -> value_scenarios!.
  • command_line.rs -- AgentPlatformType / HbnConfigMode from_str + the for value in [...] loop -> tables.
  • health.rs -- parse_status / parse_disk_utilization / parse_mlxprivhost -> tables.

Add coverage (table-shaped, currently thin/absent):

  • health.rs -- SctlState from_str + Display (8 variants, ~3 tested; Unknown fallthrough untested).
  • command_line.rs -- HbnConfigMode::from_str (zero tests today).
  • containerd/image.rs -- container_image_name_to_component regex (no direct unit tests).

Add carbide-test-support to [dev-dependencies].

Acceptance

  • Adopted clusters preserve coverage; the added tables genuinely raise it.
  • cargo test -p <agent pkg> green; cargo clippy --all-features + cargo make format-nightly clean.

Size: M-L

Part of #2692.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions