Skip to content

test(api-core): parameterize cross-entity test duplication#2717

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2699
Open

test(api-core): parameterize cross-entity test duplication#2717
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2699

Conversation

@chet

@chet chet commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Wave 1 of the carbide-test-support integration (#2692).

Three pockets of api-core cross-entity duplication, consolidated:

  • by-ids guards — every find_*_by_ids RPC re-proved the same two API-layer guards (empty list, over-max) once per entity (~20 #[sqlx_test] tests across ten *_find.rs). Now two shared tests (find_by_ids_guards.rs), each looping a labeled spread of the ten RPCs over one pool and asserting the exact InvalidArgument code + message per RPC. Guard fires before any DB work, so once per guard suffices.
  • health-override CRUD — the power-shelf / switch / rack suites repeated six CRUD behaviors fn-for-fn; the bodies move into a HealthCrud harness driven by per-entity closures (common/health_crud.rs), each entity's #[sqlx_test] calling the shared checks over its own pool. Rack's unique precedence/propagation tests stay per-entity.
  • component_managerpower_action_* (6) and error_to_status_* (5) per-variant tests become two tables; the error-mapping table adds the previously-untested TransportUnavailable and RmsInternal arms, so coverage goes up.

No production change; ~1,500 lines of duplicated suite collapse into two shared harnesses. Verified against Postgres (changed modules: 70 tests pass), clippy-clean with -D warnings.

Addresses #2699.

@chet

chet commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai PTAL, thanks!

@copy-pr-bot

copy-pr-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 73d758de-9197-41f2-a0fb-5b68b8298715

📥 Commits

Reviewing files that changed from the base of the PR and between 559b115 and 7136006.

📒 Files selected for processing (18)
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/tests/common/health_crud.rs
  • crates/api-core/src/tests/common/mod.rs
  • crates/api-core/src/tests/explored_endpoint_find.rs
  • crates/api-core/src/tests/explored_managed_host_find.rs
  • crates/api-core/src/tests/find_by_ids_guards.rs
  • crates/api-core/src/tests/ib_partition_find.rs
  • crates/api-core/src/tests/instance_find.rs
  • crates/api-core/src/tests/machine_find.rs
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/src/tests/network_segment_find.rs
  • crates/api-core/src/tests/power_shelf_find.rs
  • crates/api-core/src/tests/power_shelf_health.rs
  • crates/api-core/src/tests/rack_health.rs
  • crates/api-core/src/tests/switch_find.rs
  • crates/api-core/src/tests/switch_health.rs
  • crates/api-core/src/tests/tenant_keyset_find.rs
  • crates/api-core/src/tests/vpc_find.rs
✅ Files skipped from review due to trivial changes (2)
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/src/tests/switch_find.rs
🚧 Files skipped from review as they are similar to previous changes (16)
  • crates/api-core/src/tests/explored_managed_host_find.rs
  • crates/api-core/src/tests/network_segment_find.rs
  • crates/api-core/src/tests/ib_partition_find.rs
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/tests/explored_endpoint_find.rs
  • crates/api-core/src/tests/instance_find.rs
  • crates/api-core/src/tests/power_shelf_find.rs
  • crates/api-core/src/tests/common/mod.rs
  • crates/api-core/src/tests/vpc_find.rs
  • crates/api-core/src/tests/switch_health.rs
  • crates/api-core/src/tests/common/health_crud.rs
  • crates/api-core/src/tests/tenant_keyset_find.rs
  • crates/api-core/src/tests/power_shelf_health.rs
  • crates/api-core/src/tests/machine_find.rs
  • crates/api-core/src/tests/rack_health.rs
  • crates/api-core/src/tests/find_by_ids_guards.rs

Summary by CodeRabbit

  • Tests
    • Added a shared find_by_ids_guards test module to verify empty-list and over-limit validation behavior consistently across find_*_by_ids RPCs, and removed redundant per-endpoint SQLx checks.
    • Introduced reusable health override test utilities (health_crud) and refactored health tests (e.g., power shelf, rack, switch) to standardize CRUD, idempotency, replace-mode, visibility, and aggregation assertions.
    • Updated component manager unit tests to use consolidated, table-driven scenarios for error/status mappings and power-action control mapping.

Walkthrough

Three independent test-suite consolidations within api-core: (1) a new find_by_ids_guards module centralizes empty-list and over-max ID guard assertions across all find_*_by_ids RPCs, removing approximately forty duplicate guard-check assertions across ten per-entity test modules; (2) a generic HealthCrud harness with six check methods and check_health_aggregation function are introduced and adopted in power_shelf_health, switch_health, and rack_health; (3) component_manager tests are collapsed into table-driven forms using helpers and scenarios. No production code or public API signatures changed.

Changes

Test Consolidation: find_*_by_ids guards, HealthCrud harness, component_manager table tests

Layer / File(s) Summary
Centralized find_*_by_ids guard module
crates/api-core/src/tests/find_by_ids_guards.rs, crates/api-core/src/tests/mod.rs
New module establishes RpcGuardCase wrapper, machine_id deterministic ID generator, over_max_cases/empty_cases factories covering all representative RPCs, and two sqlx_test functions asserting Code::InvalidArgument with byte-exact error messages. Module provides single source of truth for guard validation across entire codebase.
Remove duplicate per-entity guard tests
crates/api-core/src/tests/explored_endpoint_find.rs, crates/api-core/src/tests/explored_managed_host_find.rs, crates/api-core/src/tests/ib_partition_find.rs, crates/api-core/src/tests/instance_find.rs, crates/api-core/src/tests/machine_find.rs, crates/api-core/src/tests/network_segment_find.rs, crates/api-core/src/tests/power_shelf_find.rs, crates/api-core/src/tests/switch_find.rs, crates/api-core/src/tests/tenant_keyset_find.rs, crates/api-core/src/tests/vpc_find.rs
Delete duplicate guard-check tests (two per module: empty-list and over-max-ID error cases). Remove now-unused ID-type imports. Replace with inline comments referencing centralized tests::find_by_ids_guards for audit trail.
Generic HealthCrud harness
crates/api-core/src/tests/common/health_crud.rs, crates/api-core/src/tests/common/mod.rs
Define HealthStatusView and generic HealthCrud<Id, Ins, Lst, Rem, Fnd> struct carrying entity IDs, alert/source test data, and entity-specific async RPC closures. Implement six async check methods (check_insert_list_remove, check_idempotent_insert, check_remove_nonexistent_source, check_missing_entity, check_replace_mode, check_visible_in_find) exercising full CRUD contract. Add check_health_aggregation standalone function asserting Prometheus metric distributions and verifying legacy metric absence. Register module under #[cfg(test)].
Adopt HealthCrud in power_shelf_health
crates/api-core/src/tests/power_shelf_health.rs
Add test_env constructor and power_shelf_crud helper wiring RPC closures into HealthCrud interface. Replace six standalone CRUD/visibility tests with delegated check_* method calls. Rewrite aggregation test to call check_health_aggregation with shared wiring; remove inline metric assertions.
Adopt HealthCrud in switch_health
crates/api-core/src/tests/switch_health.rs
Add test_env and switch_crud wiring. Replace inline per-test RPC assertion sequences with shared HealthCrud check methods. Delegate aggregation validation to check_health_aggregation via report builders and controller-iteration closure.
Adopt HealthCrud in rack_health
crates/api-core/src/tests/rack_health.rs
Add test_env, new_rack, and rack_crud helpers. Refactor six CRUD/visibility tests to use shared checks. Delegate aggregation to check_health_aggregation. Retain standalone DSX consumer contract test and propagation/precedence tests as independent cases.
Table-driven refactor of component_manager tests
crates/api-core/src/handlers/component_manager.rs
Add transport_error() helper for deterministic error construction. Collapse per-variant component_manager_error_to_status tests into single table-driven function asserting Code and message substrings for all variants. Collapse per-value map_power_action tests into scenario-driven function. Retain edge-case rejection tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Parameterize api-core's cross-entity test duplication #2699: This PR directly implements the three consolidation patterns described in that issue—centralizing find_*_by_ids guards into a dedicated module, introducing the parameterized HealthCrud harness, and refactoring component_manager tests into table-driven forms to eliminate per-variant/per-value redundancy.
  • carbide-test-support integration -- finish the migration, extend the coverage #2692: This PR constitutes a Wave 1 cleanup pass on api-core test infrastructure, consolidating per-variant test clusters into maintainable tables and extracting duplicated validation logic into reusable harnesses, which directly aligns with the Epic's stated objectives for test standardization and reduced redundancy.

Possibly related PRs

  • NVIDIA/infra-controller#2168: That PR refactors health-related integration test assertions to verify the legacy carbide_alerts_suppressed_count metric is not emitted; this PR incorporates that same validation pattern into the new centralized check_health_aggregation function, ensuring the metric absence check runs consistently across all health override tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(api-core): parameterize cross-entity test duplication' directly summarizes the PR's main objective of consolidating duplicated tests through parameterization across multiple entity types.
Description check ✅ Passed The description comprehensively outlines the three areas of test consolidation (by-ids guards, health-override CRUD, component_manager), explains the rationale, and quantifies the impact—clearly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

gh pr view 2717 --repo NVIDIA/infra-controller --json title,body,files,additions,deletions,changedFiles | jq '.'

Length of output: 4420


🏁 Script executed:

#!/bin/bash
set -euo pipefail

gh pr diff 2717 --repo NVIDIA/infra-controller 2>/dev/null | head -3000

Length of output: 109858



@chet — clean structural work. ~1,500 lines of per-entity repetition collapsed into two harnesses with no production change and expanded coverage on the Transport/Rms arms. A few items worth addressing before merge:


1. VpcId::default() generates identical IDs in over_max_cases (correctness concern)

crates/api-core/src/tests/find_by_ids_guards.rs — the VPC row in over_max_cases:

vpc_ids: (1..=over).map(|_| VpcId::default()).collect(),

Every element is the same zero-UUID. Every other RPC in this list generates over distinct IDs via uuid::Uuid::new_v4(). If the VPC handler ever deduplicates before the length guard (e.g. a DISTINCT pre-pass), this test would silently regress to exercising n=1 rather than n=over. Align with the pattern used by every other case:

vpc_ids: (1..=over).map(|_| VpcId::from(uuid::Uuid::new_v4())).collect(),

2. Unnecessary DB entity creation in every test_missing_* callsite

power_shelf_health.rs, switch_health.rs, rack_health.rs — for example:

#[crate::sqlx_test]
async fn test_missing_power_shelf_id(pool: sqlx::PgPool) -> Result<(), Box<dyn std::error::Error>> {
    let env = test_env(pool).await;
    let id = new_power_shelf(&env, None, None, None, None).await?;  // ← inserted but unused
    power_shelf_crud(&env, id).check_missing_entity().await;
    Ok(())
}

check_missing_entity drives self.nonexistent_id exclusively; real_id (the persisted entity) is never touched. A real insert is paid for every missing-entity test. The simplest fix is to make check_missing_entity a free function or allow constructing a HealthCrud with only the fields it needs. Alternatively, document on HealthCrud that real_id may be left as a default/dummy when only check_missing_entity is called. As written, every entity wastes one INSERT per invocation.


3. check_health_aggregation re-inlines the insert RPC shape

power_shelf_health.rs, switch_health.rs, rack_health.rs — each aggregation test passes a fresh inline async |id, report, mode| { ... } closure to check_health_aggregation that is structurally identical to the insert closure inside *_crud(). The two code paths are not shared:

// power_shelf_health.rs – inside check_health_aggregation call
async |id, report: HealthReport, mode| {
    let report: rpc::health::HealthReport = report.into();
    env.api.insert_power_shelf_health_report(Request::new(...)).await.map(|_| ())
},

// power_shelf_health.rs – inside power_shelf_crud()
insert: async move |id, report: HealthReport, mode| {
    let report: rpc::health::HealthReport = report.into();
    env.api.insert_power_shelf_health_report(Request::new(...)).await.map(|_| ())
},

If InsertPowerShelfHealthReportRequest gains a new required field tomorrow, there are two places to update per entity. Consider threading the aggregation check through HealthCrud itself (e.g. crud.check_aggregation(&meter, &env, run_iteration).await), or at minimum extract a small named helper per entity.


4. Inconsistent range syntax in over_max_cases (cosmetic)

Some rows use (1..=over), others use (0..over) — both produce over elements but read differently:

// switches, power_shelves
(0..over).map(|_| SwitchId::from(uuid::Uuid::new_v4()))

// machines, instances, vpcs, network_segments …
(1..=over).map(|_| …)

Standardising on (0..over) throughout would reduce cognitive overhead for readers verifying that every RPC receives exactly max + 1 IDs.


5. transport_error() helper: comment on infallibility is accurate but the mechanism deserves a note

fn transport_error() -> tonic::transport::Error {
    tonic::transport::Endpoint::new("not a valid uri")
        .expect_err("an invalid endpoint URI should fail to parse")
}

The expect_err will panic if tonic's URI validation changes to accept this string. A short inline remark tying the expectation to the tonic API contract (e.g. "tonic validates URIs synchronously; this string is not a valid URI under any scheme") would make the intent self-documenting and help future maintainers if tonic changes behavior.


Overall this is a well-executed refactor — the HealthCrud harness is genuinely elegant, the AsyncFn bounds are idiomatic, and the guard-loop approach in find_by_ids_guards.rs is exactly the right tradeoff between isolation and duplication. The VpcId::default() item (#1) is the only correctness risk; the rest are maintainability suggestions.

@chet

chet commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
crates/api-core/src/tests/common/health_crud.rs (1)

215-223: ⚡ Quick win

Reduce duplicate insert wiring in aggregation checks.

check_health_aggregation currently takes real_id + insert separately, which forces each entity test module to duplicate the same insert request-shape closure already present in its HealthCrud setup. Consider accepting a &HealthCrud<...> (or a small shared adapter) so CRUD and aggregation share one wiring path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/api-core/src/tests/common/health_crud.rs` around lines 215 - 223, The
check_health_aggregation function currently accepts real_id and insert as
separate parameters, forcing duplicate insert request-shape closure definitions
in each entity test module. Refactor the function signature to accept a
reference to HealthCrud instead of these separate parameters, extracting the
real_id and insert logic from the HealthCrud object within the function body.
This will allow all test modules to reuse the same insert wiring from their
existing HealthCrud setup rather than duplicating it.
crates/api-core/src/tests/power_shelf_health.rs (1)

172-176: ⚡ Quick win

Avoid creating a real entity in the missing-entity test.

check_missing_entity() only exercises nonexistent_id, so creating a persisted power shelf here is unused setup and adds avoidable DB work.

Lean test setup
 async fn test_missing_power_shelf_id(pool: sqlx::PgPool) -> Result<(), Box<dyn std::error::Error>> {
     let env = test_env(pool).await;
-    let id = new_power_shelf(&env, None, None, None, None).await?;
-    power_shelf_crud(&env, id).check_missing_entity().await;
+    let dummy_real_id = PowerShelfId::from(uuid::Uuid::new_v4());
+    power_shelf_crud(&env, dummy_real_id).check_missing_entity().await;
     Ok(())
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/api-core/src/tests/power_shelf_health.rs` around lines 172 - 176, The
test_missing_power_shelf_id function unnecessarily creates a real power shelf
entity via new_power_shelf() when check_missing_entity() only exercises
nonexistent_id and doesn't use the created entity. Remove the new_power_shelf
call and instead create a nonexistent ID directly (likely a UUID or equivalent
identifier) and pass that to power_shelf_crud() to eliminate unnecessary
database setup work.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/api-core/src/tests/common/health_crud.rs`:
- Around line 137-149: The check_missing_entity method currently uses a generic
is_err() assertion which will pass for any error type, making it vulnerable to
regressions where the error status changes from NotFound to something else.
Instead of just asserting that result is an error, extract the actual error from
the result and verify that it contains the specific NotFound gRPC status code.
This ensures the test properly validates that the expected NotFound status is
returned when attempting to insert an override for a nonexistent entity.

In `@crates/api-core/src/tests/find_by_ids_guards.rs`:
- Around line 151-153: The over-max guard test case in find_vpcs_by_ids is
creating multiple copies of VpcId::default() instead of generating distinct IDs.
This means if the VPC path ever adds deduplication logic before the guard check,
the test would silently stop testing the actual over-limit path. Replace the map
function that generates vpc_ids to create unique/distinct VpcId values (like
incrementing based on the loop variable) instead of reusing VpcId::default() for
each iteration.

---

Nitpick comments:
In `@crates/api-core/src/tests/common/health_crud.rs`:
- Around line 215-223: The check_health_aggregation function currently accepts
real_id and insert as separate parameters, forcing duplicate insert
request-shape closure definitions in each entity test module. Refactor the
function signature to accept a reference to HealthCrud instead of these separate
parameters, extracting the real_id and insert logic from the HealthCrud object
within the function body. This will allow all test modules to reuse the same
insert wiring from their existing HealthCrud setup rather than duplicating it.

In `@crates/api-core/src/tests/power_shelf_health.rs`:
- Around line 172-176: The test_missing_power_shelf_id function unnecessarily
creates a real power shelf entity via new_power_shelf() when
check_missing_entity() only exercises nonexistent_id and doesn't use the created
entity. Remove the new_power_shelf call and instead create a nonexistent ID
directly (likely a UUID or equivalent identifier) and pass that to
power_shelf_crud() to eliminate unnecessary database setup work.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 666e6119-07bc-46f8-bbb8-e38fcc2678d2

📥 Commits

Reviewing files that changed from the base of the PR and between 79e54c0 and bdc36b2.

📒 Files selected for processing (18)
  • crates/api-core/src/handlers/component_manager.rs
  • crates/api-core/src/tests/common/health_crud.rs
  • crates/api-core/src/tests/common/mod.rs
  • crates/api-core/src/tests/explored_endpoint_find.rs
  • crates/api-core/src/tests/explored_managed_host_find.rs
  • crates/api-core/src/tests/find_by_ids_guards.rs
  • crates/api-core/src/tests/ib_partition_find.rs
  • crates/api-core/src/tests/instance_find.rs
  • crates/api-core/src/tests/machine_find.rs
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/src/tests/network_segment_find.rs
  • crates/api-core/src/tests/power_shelf_find.rs
  • crates/api-core/src/tests/power_shelf_health.rs
  • crates/api-core/src/tests/rack_health.rs
  • crates/api-core/src/tests/switch_find.rs
  • crates/api-core/src/tests/switch_health.rs
  • crates/api-core/src/tests/tenant_keyset_find.rs
  • crates/api-core/src/tests/vpc_find.rs

Comment thread crates/api-core/src/tests/common/health_crud.rs
Comment thread crates/api-core/src/tests/find_by_ids_guards.rs
@chet

chet commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai On the rest -- all intended/minor: check_health_aggregation takes its own insert closure deliberately (it drives controller iterations, and the crud insert is an unnameable impl AsyncFn field that cannot be handed to the free fn); the (1..=over)/(0..over) mix is harmless since every row builds over ids and the guard only checks length; the redundant fixture insert in the test_missing_* cases and the transport_error note are minor and can tidy in a follow-up. Thanks for checking!

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@chet — understood on all counts. The impl AsyncFn opaqueness genuinely precludes passing self.insert to a free function (Rust's current lack of naming for closure types makes this unavoidable without boxing), so the separate closure in check_health_aggregation is the correct approach — that concern is withdrawn. The (1..=over) / (0..over) equivalence is also clear once you know the invariant is length-only, so no objection there either.

For the two deferred items — the unnecessary INSERT in test_missing_* callsites (#2) and the transport_error contract note (#5) — would you like me to open a follow-up GitHub issue to track them so they are not lost between PRs?

@chet

chet commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai No need to open a separate issue -- both are trivial test-only tidy-ups, fine to leave. Thanks for the thorough pass!

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@chet — acknowledged. Both tidy-ups are low-stakes test-only matters and can be addressed opportunistically in a later pass without ceremony. The refactor lands in good shape; happy to review the next wave when it's ready.

(=^ ᴥ ^=)

@chet chet marked this pull request as ready for review June 21, 2026 04:16
@chet chet requested a review from a team as a code owner June 21, 2026 04:16
Every `find_*_by_ids` RPC re-proved the same two API-layer guards -- empty list
and over-max -- once per entity, ~20 near-identical `#[sqlx_test]` tests across ten
`*_find.rs` files. They collapse into two shared tests (`find_by_ids_guards.rs`),
each running a labeled spread of the ten RPCs over one pool and asserting the
exact `InvalidArgument` code and message per RPC. The guard fires ahead of any DB
work, so proving it once per guard is enough.

The power-shelf, switch, and rack health-override suites each implemented the same
six CRUD behaviors fn-for-fn. Those bodies move once into a `HealthCrud` harness
driven by per-entity closures (`common/health_crud.rs`); each entity's
`#[sqlx_test]` builds the harness over its own pool and calls the shared checks.
Rack's unique override-precedence and host-propagation tests stay per-entity.

The six `power_action_*` and five `error_to_status_*` per-variant tests in
`component_manager` become two tables; the error-mapping table also gains the
previously-untested `Transport` (-> `Unavailable`) and `Rms` (-> `Internal`) arms,
so the merge raises coverage rather than just shrinking the file.

No production change. About 1,500 lines of duplicated suite collapse into two
shared harnesses. Verified against Postgres -- the changed modules (70 tests)
pass.

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 264 6 23 99 6 130
machine-validation-runner 704 34 183 258 35 194
machine_validation 704 34 183 258 35 194
nvmetal-carbide 704 34 183 258 35 194
TOTAL 2382 108 572 879 111 712

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants