api-db and health carry duplication the helper was meant to remove: the same expected-entity CRUD suite written once per entity, an IP-candidate trio that differs only by input, and two tests that can't fail. Consolidate the trios into a shared helper or a table and drop the dead ones. Test-only; no behavior change.
Scope
api-db
- Merge the three
expected_{machine,switch,power_shelf} CRUD suites -- test_lookup_by_mac, test_duplicate_fail_create, test_update_bmc_credentials, test_delete, identical modulo entity -- into a shared generic helper (each #[sqlx_test] still needs its own pool, so this is a parameterized helper, not a single table).
- Collapse the IPv4 candidate trio into one
check_cases table (ip_allocator.rs); keep test_v4_single_ip_candidate (distinct).
- Drop the pure ORM round-trips in
expected_rack/tests.rs (insert then read back unchanged).
health
- Delete
test_should_monitor_key_consistency (sharding.rs) -- it asserts f(x) == f(x).
- Fix or delete
test_sync_with_duplicate_addresses_in_input (route_servers.rs) -- it declares both Ok and Err acceptable, so it cannot fail; if there's a real uniqueness contract, assert it.
Acceptance
- The three CRUD suites run through one shared helper; coverage preserved.
cargo test green for both crates; cargo clippy --all-features clean.
Size: S-M
Part of #2692.
api-dbandhealthcarry duplication the helper was meant to remove: the same expected-entity CRUD suite written once per entity, an IP-candidate trio that differs only by input, and two tests that can't fail. Consolidate the trios into a shared helper or a table and drop the dead ones. Test-only; no behavior change.Scope
api-db
expected_{machine,switch,power_shelf}CRUD suites --test_lookup_by_mac,test_duplicate_fail_create,test_update_bmc_credentials,test_delete, identical modulo entity -- into a shared generic helper (each#[sqlx_test]still needs its own pool, so this is a parameterized helper, not a single table).check_casestable (ip_allocator.rs); keeptest_v4_single_ip_candidate(distinct).expected_rack/tests.rs(insert then read back unchanged).health
test_should_monitor_key_consistency(sharding.rs) -- it assertsf(x) == f(x).test_sync_with_duplicate_addresses_in_input(route_servers.rs) -- it declares bothOkandErracceptable, so it cannot fail; if there's a real uniqueness contract, assert it.Acceptance
cargo testgreen for both crates;cargo clippy --all-featuresclean.Size: S-M
Part of #2692.