Skip to content

test(health): enumerate configuration validation boundaries#3971

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3967
Jul 23, 2026
Merged

test(health): enumerate configuration validation boundaries#3971
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3967

Conversation

@chet

@chet chet commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Configuration validation was spread across one mutable assertion sequence, repeated child-validator tests, and several is_err() checks that did not pin which rule rejected an input.

This replaces those tests with independent carbide-test-support scenarios. Direct tables now own the cluster, static endpoint, OTLP, TLS, log collector, and NMX-C contracts, while the top-level table keeps its own rules and representative delegation checks. Each failure row compares the exact error text.

The expansion rows cover the previously missing cluster-source contract, static power-shelf and switch identities, OTLP flush/TLS boundaries, switch mTLS paths, SSE zero backoffs, log delegation, report-sink workers, and invalid metrics endpoints.

Coverage checkpoints from the same parent:

  • selected validator lines: 291/331 -> 291/331 -> 331/331
  • selected validator regions: 312/354 -> 312/354 -> 354/354
  • config.rs production lines: 629/713 -> 629/713 -> 688/713
  • package uncovered lines: 5,383 -> 5,383 -> 5,321

Related issues

Supports #3967

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.)

cargo test --locked --package carbide-health --lib

cargo make format-nightly

cargo make clippy

cargo make carbide-lints

Additional Notes

The conversion-only checkpoint preserved every covered production line and region before the expansion rows were added. Twelve repeated test functions and overlapping top-level child-validator cases were removed or consolidated.

Closes #3967

Replace the mutable top-level validation sequence and repeated log, TLS, and NMX-C tests with independent carbide-test-support scenarios that pin exact errors.

Add the missing cluster, endpoint identity, OTLP TLS, SSE, worker, and metrics boundaries while keeping child validators authoritative.

This supports NVIDIA#3967

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet requested a review from a team as a code owner July 23, 2026 10:27
@chet

chet commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@chet: Understood — I’ll perform a complete review of the PR.

ᕱ⑅ᕱ

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 23, 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: 29d7c3d1-f3f2-4cb6-b1b7-51a34bfd532c

📥 Commits

Reviewing files that changed from the base of the PR and between 2de970b and d1a0827.

📒 Files selected for processing (1)
  • crates/health/src/config.rs

Summary by CodeRabbit

  • Tests
    • Expanded configuration validation coverage across endpoints, logging modes, TLS options, OTLP settings, NMX-C, GPU inventory dependencies, and sink worker counts.
    • Added scenario-based tests for both successful and failure cases, improving readability and consistency of validation expectations.
    • Improved verification of effective logging configuration resolution, including automatic/periodic behavior and SSE/auto-mode fallbacks.
    • Consolidated shared test setup to reduce duplication and centralize configuration validation checks.

Walkthrough

The PR refactors health configuration tests with shared builders, projection helpers, and scenarios!-based validation. Coverage is consolidated for core configuration, OTLP, NMX-C, TLS profiles, and log collector modes. Production configuration declarations remain unchanged.

Changes

Health configuration test modernization

Layer / File(s) Summary
Shared test harness and core validation
crates/health/src/config.rs
Adds reusable configuration and log projection helpers, then consolidates cluster endpoint, static endpoint, and top-level configuration validation scenarios.
Specialized sink and TLS validation
crates/health/src/config.rs
Rewrites OTLP, NMX-C, and switch TLS validation and parsing tests using scenario-based cases.
Logs mode validation and parsing
crates/health/src/config.rs
Consolidates SSE, auto-mode, collector validation, and effective log configuration parsing coverage.

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

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR's main change: enumerating health configuration validation boundaries in tests.
Description check ✅ Passed The description is detailed and directly describes the test refactor and expanded validation coverage in this PR.
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.

@chet
chet enabled auto-merge (squash) July 23, 2026 14:29
@chet
chet merged commit 2518331 into NVIDIA:main Jul 23, 2026
61 checks passed
@chet
chet deleted the gh-issue-3967 branch July 23, 2026 15:58
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.

test(health): enumerate configuration validation boundaries

2 participants