Skip to content

test(api-core): move compute allocation tests to integration suite#3271

Open
poroh wants to merge 1 commit into
NVIDIA:mainfrom
poroh:test-compute-allocation-to-integration
Open

test(api-core): move compute allocation tests to integration suite#3271
poroh wants to merge 1 commit into
NVIDIA:mainfrom
poroh:test-compute-allocation-to-integration

Conversation

@poroh

@poroh poroh commented Jul 8, 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

Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
@poroh poroh requested a review from a team as a code owner July 8, 2026 19:36
@coderabbitai

coderabbitai Bot commented Jul 8, 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: 90fcd309-06b1-4620-8115-959d9c6b86b1

📥 Commits

Reviewing files that changed from the base of the PR and between b715487 and 8a70c33.

📒 Files selected for processing (3)
  • crates/api-core/src/tests/mod.rs
  • crates/api-core/tests/integration/compute_allocation.rs
  • crates/api-core/tests/integration/main.rs
💤 Files with no reviewable changes (1)
  • crates/api-core/src/tests/mod.rs

Summary by CodeRabbit

  • Tests
    • Expanded automated coverage for compute allocation enforcement across multiple scenarios.
    • Updated integration test setup and helper handling to better match current configuration and database pool usage.
    • Removed an outdated test entry and added the integration test to the main suite.

Walkthrough

The compute_allocation test suite is relocated from the unit test module to the integration test module. Imports and helper functions are reworked to use local implementations, and numerous test functions are updated to use #[sqlx_test] and PgPool instead of crate-qualified equivalents.

Changes

Compute allocation test relocation

Layer / File(s) Summary
Module relocation wiring
crates/api-core/src/tests/mod.rs, crates/api-core/tests/integration/main.rs
Removes the compute_allocation submodule declaration from the unit test index and adds it to the integration test entry point.
Imports and local test helpers
crates/api-core/tests/integration/compute_allocation.rs
Reworks imports to updated module paths, adds local helpers for network/OS config, metadata, and enforcement override scaffolding using PgPool.
Instance creation allocation tests
crates/api-core/tests/integration/compute_allocation.rs
Converts test signatures for basic actions and no/sufficient/insufficient allocation scenarios (with/without instance type ID) across enforcement modes to #[sqlx_test] + PgPool.
Allocation delete/update and machine association tests
crates/api-core/tests/integration/compute_allocation.rs
Converts delete-allocation, update-allocation reduce/increase, and remove-machine-association test signatures across enforcement modes to #[sqlx_test] + PgPool.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately states the main change: moving compute allocation tests into the integration suite.
Description check ✅ Passed The description is related to the changeset and correctly frames it as an internal test refactor with updated tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@github-actions

github-actions Bot commented Jul 8, 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 271 13 34 91 7 126
machine-validation-runner 776 37 223 281 40 195
machine_validation 776 37 223 281 40 195
machine_validation-aarch64 776 37 223 281 40 195
nvmetal-carbide 776 37 223 281 40 195
TOTAL 3381 161 926 1221 167 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