Skip to content

test: stabilize platform vitest main checks#4122

Merged
ericksoa merged 1 commit into
mainfrom
fix/platform-vitest-main-tests
May 23, 2026
Merged

test: stabilize platform vitest main checks#4122
ericksoa merged 1 commit into
mainfrom
fix/platform-vitest-main-tests

Conversation

@ericksoa
Copy link
Copy Markdown
Contributor

@ericksoa ericksoa commented May 23, 2026

Summary

  • scope the restricted dmesg CLI assertion to Linux, where NemoClaw actually calls dmesg
  • make credential-back onboard scenarios select menu entries by visible label instead of platform-dependent numeric positions
  • give the Ollama systemd loopback override test the shared provider-selection timeout

Validation

  • npm run build:cli
  • npx vitest run test/onboard-selection.test.ts --testTimeout 120000
  • npx vitest run test/onboard-selection.test.ts -t "secret credential prompt" --testTimeout 120000
  • npx vitest run test/onboard-selection.test.ts -t "applies the systemd loopback override" --testTimeout 120000
  • npx vitest run src/lib/diagnostics/debug.test.ts --testTimeout 30000
  • npx vitest run test/cli.test.ts -t "debug --quick explains restricted dmesg" --testTimeout 30000
  • npx tsc -p tsconfig.src.json --noEmit
  • git diff --check

Note: local pre-push full CLI coverage failed before push on unrelated local artifact setup (nemoclaw/dist/blueprint/private-networks.js and nemoclaw/node_modules/json5 missing), plus existing macOS-local CLI test noise. The targeted failures from Platform Vitest Main Watch are covered above.

Summary by CodeRabbit

Tests

  • Improved test infrastructure for multi-step provider selection workflows with enhanced menu tracking and selection automation
  • Made platform-specific tests conditionally skip on non-Linux systems

Review Change Stack

@ericksoa ericksoa added the v0.0.50 Release target label May 23, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

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: 8c58ee80-eaa3-4b2e-9c58-69d6149cad65

📥 Commits

Reviewing files that changed from the base of the PR and between 14b2be2 and da392c6.

📒 Files selected for processing (2)
  • test/cli.test.ts
  • test/onboard-selection.test.ts

📝 Walkthrough

Walkthrough

The PR extends the credential-back test harness to support dynamic multi-step provider selection flows by introducing menu-aware prompt matching and state tracking, while also guarding a platform-specific CLI test to run only on Linux.

Changes

Multi-step Menu Selection in Credential-Back Tests

Layer / File(s) Summary
Scenario type contract with menuSelections
test/onboard-selection.test.ts
CredentialBackScenario gains optional menuSelections?: string[] field to configure dynamic menu option selection.
Subprocess initialization and output capture
test/onboard-selection.test.ts
Subprocess script now initializes menuSelectionIndex, defines menuSelections from scenario, and introduces lines buffer to capture console output for menu matching.
Menu selection matching and prompt integration
test/onboard-selection.test.ts
selectRecentMenuOption helper scans captured output for the most recent "Choose […]" menu entry matching a provided label, and integrates into credentials.prompt to handle "Choose" prompts when menuSelections are configured; falls back to answers otherwise. Redundant output buffer initialization is removed.
Subprocess result payloads with menuSelectionIndex
test/onboard-selection.test.ts
Both subprocess success and exit result payloads now include menuSelectionIndex value alongside other captured data.
Parent test assertion and timeout constant
test/onboard-selection.test.ts
Parent test asserts menuSelectionIndex matches scenario.menuSelections?.length, and systemd loopback override test switches to PROVIDER_SELECTION_TEST_TIMEOUT_MS constant instead of hardcoded 10_000.
Provider scenarios updated for menu selection
test/onboard-selection.test.ts
Model Router, Hermes Provider Nous API Key, and Local NIM NGC API Key scenarios adjusted to use new menuSelections mechanism with simplified answers sequences for multi-step provider selection flows.

CLI Platform-Specific Test Guard

Layer / File(s) Summary
Debug test Linux-only skip guard
test/cli.test.ts
debug --quick "restricted dmesg" test wrapped in it.skipIf(os.platform() !== "linux") and description updated to include "on Linux".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#4108: The test/onboard-selection.test.ts changes directly connect to the managed Ollama loopback override behavior and systemd service tests.

Suggested labels

NemoClaw CLI, CI/CD

Suggested reviewers

  • jyaunches
  • cv

Poem

🐰 With menus dancing through the test, we skip on platforms that need rest,
Each "Choose" now captured, matched with care—the subprocess flows without despair!
Menu selections traced and true, credentials prompt the way they should do. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objectives: scoping Linux-specific tests, stabilizing credential-back selection for cross-platform compatibility, and adjusting timeout handling—all aimed at stabilizing vitest checks across platforms.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/platform-vitest-main-tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@github-actions
Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is recommended because this PR only changes existing tests and test harness behavior. It cannot affect runtime user flows, installer/onboarding logic, sandbox lifecycle, credentials handling, security boundaries, network policy, inference routing, or deployment behavior.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. No scenario workflow, scenario metadata, scenario runtime, or validation-suite files changed.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@github-actions
Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas
Top item: No actionable code findings

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@ericksoa ericksoa merged commit 4fce71d into main May 23, 2026
30 checks passed
@ericksoa ericksoa deleted the fix/platform-vitest-main-tests branch May 23, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.50 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants