Skip to content

tests(api-core): move power shelf tests to integration and DB suites#3393

Open
poroh wants to merge 1 commit into
NVIDIA:mainfrom
poroh:tests-power-shelf-modernization
Open

tests(api-core): move power shelf tests to integration and DB suites#3393
poroh wants to merge 1 commit into
NVIDIA:mainfrom
poroh:tests-power-shelf-modernization

Conversation

@poroh

@poroh poroh commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Related issues

#2001

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

[ ] This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@poroh poroh requested a review from a team as a code owner July 11, 2026 00:30
@coderabbitai

coderabbitai Bot commented Jul 11, 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: d0e84343-9dc3-42c6-82ce-dbefb305cedb

📥 Commits

Reviewing files that changed from the base of the PR and between ef92e38 and 5007bbc.

📒 Files selected for processing (14)
  • crates/api-core/Cargo.toml
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/src/tests/power_shelf.rs
  • crates/api-core/tests/integration/main.rs
  • crates/api-core/tests/integration/power_shelf.rs
  • crates/api-core/tests/integration/power_shelf_delete.rs
  • crates/api-core/tests/integration/power_shelf_find.rs
  • crates/api-core/tests/integration/power_shelf_maintenance.rs
  • crates/api-db/Cargo.toml
  • crates/api-db/src/lib.rs
  • crates/api-db/src/power_shelf.rs
  • crates/api-db/src/test_support/mod.rs
  • crates/api-db/src/test_support/power_shelf.rs
  • crates/rpc/src/model/power_shelf.rs
💤 Files with no reviewable changes (2)
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/src/tests/power_shelf.rs

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation coverage for power shelf maintenance requests, including invalid, deleted, and unknown shelves.
    • Expanded coverage for soft deletion, force deletion, missing shelves, and retained history.
  • Tests

    • Added integration coverage for power shelf creation, lookup, filtering, deletion, maintenance, and model conversion.
    • Standardized power shelf test data and added reusable test setup helpers.
    • Added checks for multi-shelf operations, maintenance references, and request replacement behavior.

Walkthrough

Shared database fixtures are exposed through a test-support feature, reused by api-db tests, and consumed by new API integration tests for power shelf lookup, deletion, and maintenance. RPC model conversion also gains unit coverage.

Changes

Power shelf testing

Layer / File(s) Summary
Shared database test support
crates/api-db/Cargo.toml, crates/api-db/src/lib.rs, crates/api-db/src/test_support/*
Adds feature-gated public test support with deterministic and random power shelf creation helpers.
Database test fixture migration
crates/api-db/src/power_shelf.rs
Updates database tests to use the shared seeded fixture constructors and deterministic identifiers.
API integration coverage
crates/api-core/Cargo.toml, crates/api-core/src/tests/*, crates/api-core/tests/integration/*
Adds integration coverage for power shelf lookup, soft and force deletion, maintenance persistence, overwrite behavior, and invalid requests; registers the new test modules and removes the prior unit-test module declaration.
RPC conversion validation
crates/rpc/src/model/power_shelf.rs
Adds unit coverage for model-to-RPC conversion of power shelf identity, configuration, and status.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating power shelf tests from unit tests into integration and DB suites.
Description check ✅ Passed The description is clearly related to the changeset and correctly frames it as an internal test migration.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
@poroh poroh force-pushed the tests-power-shelf-modernization branch from 78dcedd to 5007bbc Compare July 11, 2026 00:32
@github-actions

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 271 13 34 91 7 126
machine-validation-runner 804 40 237 296 36 195
machine_validation 804 40 237 296 36 195
machine_validation-aarch64 804 40 237 296 36 195
nvmetal-carbide 804 40 237 296 36 195
TOTAL 3493 173 982 1281 151 906

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.

1 participant