Skip to content

refactor(test): consolidate integration tests into single binary#2960

Merged
poroh merged 1 commit into
NVIDIA:mainfrom
poroh:consolidate-db-integration-binaries
Jun 29, 2026
Merged

refactor(test): consolidate integration tests into single binary#2960
poroh merged 1 commit into
NVIDIA:mainfrom
poroh:consolidate-db-integration-binaries

Conversation

@poroh

@poroh poroh commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Group site-explorer and preingestion-manager integration suites under one explicit Cargo test target per crate.

This reduces SQLx migrated-template initialization from once per test executable to once per crate-level integration binary, while preserving per-test isolated database clones. It also reduces compilation and linking overhead by building one integration test binary instead of many.

Shared test helpers are moved under the integration module trees so they are no longer discovered as standalone test targets.

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 June 28, 2026 20:18
@coderabbitai

coderabbitai Bot commented Jun 28, 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: 355a4f6f-5ce4-4e7c-820f-b1b477fcbb1d

📥 Commits

Reviewing files that changed from the base of the PR and between 2698e2f and a64828e.

📒 Files selected for processing (15)
  • crates/preingestion-manager/Cargo.toml
  • crates/preingestion-manager/tests/integration/common.rs
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/preingestion-manager/tests/integration/main.rs
  • crates/preingestion-manager/tests/integration/time_sync.rs
  • crates/site-explorer/Cargo.toml
  • crates/site-explorer/tests/integration/env.rs
  • crates/site-explorer/tests/integration/health_report.rs
  • crates/site-explorer/tests/integration/machine_creator.rs
  • crates/site-explorer/tests/integration/main.rs
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/reconcile.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
  • crates/site-explorer/tests/integration/switch.rs
  • crates/site-explorer/tests/integration/zero_dpu.rs
💤 Files with no reviewable changes (2)
  • crates/site-explorer/tests/integration/power_shelf.rs
  • crates/site-explorer/tests/integration/switch.rs
✅ Files skipped from review due to trivial changes (3)
  • crates/preingestion-manager/tests/integration/host_bmc_firmware.rs
  • crates/preingestion-manager/tests/integration/main.rs
  • crates/site-explorer/tests/integration/site_explorer.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • crates/site-explorer/tests/integration/main.rs
  • crates/preingestion-manager/Cargo.toml
  • crates/preingestion-manager/tests/integration/time_sync.rs
  • crates/site-explorer/Cargo.toml

Summary by CodeRabbit

  • Tests
    • Added explicit integration test entry points for two components, making integration suites easier to run as single executables.
    • Consolidated shared integration test helpers so suites reuse common setup consistently.
    • Updated multiple integration tests to consistently import shared helpers/environment from the crate scope.

Walkthrough

Both crates add explicit integration-test targets and new tests/integration/main.rs entrypoints. The integration subtests now share helpers through crate-level imports instead of local mod declarations.

Changes

Integration Test Consolidation

Layer / File(s) Summary
preingestion-manager test binary
crates/preingestion-manager/Cargo.toml, crates/preingestion-manager/tests/integration/main.rs, crates/preingestion-manager/tests/integration/host_bmc_firmware.rs, crates/preingestion-manager/tests/integration/time_sync.rs
Adds a [[test]] target, introduces main.rs for common, host_bmc_firmware, and time_sync, and switches both subtests to use crate::common;.
site-explorer test binary
crates/site-explorer/Cargo.toml, crates/site-explorer/tests/integration/main.rs, crates/site-explorer/tests/integration/power_shelf.rs, crates/site-explorer/tests/integration/site_explorer.rs, crates/site-explorer/tests/integration/switch.rs
Adds a [[test]] target, introduces main.rs wiring the integration modules, removes local mod env; declarations where present, and updates site_explorer.rs to import crate::env alongside Env.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • NVIDIA/infra-controller#2927: Introduced the shared preingestion-manager integration test helpers and module layout that this PR updates to crate-level imports.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: consolidating integration tests into one binary for refactoring and performance.
Description check ✅ Passed The description accurately describes the crate-level integration test consolidation, helper relocation, and resulting SQLx and build-time benefits.
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.

Group site-explorer and preingestion-manager integration suites under one
explicit Cargo test target per crate.

This reduces SQLx migrated-template initialization from once per test
executable to once per crate-level integration binary, while preserving
per-test isolated database clones. It also reduces compilation and linking
overhead by building one integration test binary instead of many.

Shared test helpers are moved under the integration module trees so they are
no longer discovered as standalone test targets.

Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
@poroh poroh force-pushed the consolidate-db-integration-binaries branch from 2698e2f to a64828e Compare June 28, 2026 20:19
@poroh poroh changed the title refactor(test): consolidate DB integration tests into single binary refactor(test): consolidate integration tests into single binary Jun 28, 2026
@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 285 6 25 103 7 144
machine-validation-runner 748 30 189 272 36 221
machine_validation 748 30 189 272 36 221
machine_validation-aarch64 748 30 189 272 36 221
nvmetal-carbide 748 30 189 272 36 221
TOTAL 3283 126 781 1197 151 1028

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

@poroh poroh merged commit 4e26dae into NVIDIA:main Jun 29, 2026
59 checks passed
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