test(e2e): avoid inference calls in hosted reachability probe - #5411
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesHosted-inference probe simplification and test coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas This is an automated advisory review. A human maintainer must make the final merge decision. |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
## Summary Restore issue #5800 parity package `P0-A` for merged bash-suite inference-helper deltas only. This is a focused support-test parity PR: the helper/product behavior already exists on `main`; this adds missing Vitest assertions so shell retirement keeps the hosted/hermetic inference contracts covered. ## Related Issues Refs #5800 Refs #5098 Refs #5373 Refs #5374 Refs #5385 Refs #5395 Refs #5399 Refs #5400 Refs #5411 Refs #5751 Refs #5672 Refs #5757 ## Scope gate - Package: `P0-A — Hosted/hermetic inference helper parity` - Included PRs all merged and touched `test/e2e`: yes - Out of scope: unmerged/non-bash PRs; product cleanup; shell lane retirement / PR #5756 cleanup ## Parity map | ID | Source PR | Contract | Inference classification | Vitest assertion / waiver | Status | | --- | --- | --- | --- | --- | --- | | A1 | #5373 | Fake OpenAI-compatible helper supports `/models`, chat completions, responses API, auth checking, and request capture. | `hermetic-default` | `test/e2e-scenario/support-tests/hosted-inference.test.ts` starts `startFakeOpenAiCompatibleServer` and asserts models/chat/responses/request log behavior. | covered | | A2 | #5374, #5385, #5395 | Hosted CI inference stages `NVIDIA_INFERENCE_API_KEY` as `COMPATIBLE_API_KEY`, routes as `custom`/`compatible-endpoint`, and prefers `openai-completions`. | `hosted-compatible capable` | Existing workflow/helper assertions plus new shell helper staging assertion in `hosted-inference.test.ts`. | covered | | A3 | #5399, #5751, #5672, #5757 | Hosted model default remains the Inference Hub provider/namespace/model ID `nvidia/nvidia/nemotron-3-ultra`; explicit `NEMOCLAW_MODEL` takes precedence over `NEMOCLAW_COMPAT_MODEL`, which takes precedence over helper options/default. | `hosted-compatible capable` | New `requireHostedInferenceConfig` model precedence/default assertion; existing workflow/model namespace tests remain green. | covered | | A4 | #5400, #5411 | Hosted reachability probe is bounded and low-cost: no `/models`, chat completions, auth header, or bearer token spend. | `hosted-compatible capable` | Existing probe tests retained and revalidated. | covered | | A5 | #5385 | Public NVIDIA/nvapi shell mode remains distinct from hosted-compatible mode and is not restaged as compatible inference. | `public-nvidia required` | New shell helper assertion checks `nvapi-*` + `cloud` keeps `nvidia-prod`, leaves `COMPATIBLE_API_KEY` unset. | covered | ## Inference mode support - Default mode for touched live targets: none touched; this PR only changes support tests. - Real inference support preserved: yes, by asserting hosted-compatible and public-NVIDIA helper boundaries without invoking real inference. - Modes validated in this PR: hermetic fake endpoint and shell helper mocked hosted-compatible/public boundary. - If not validated with real inference: not required; no live target or hosted secret path changed. ## Validation - [x] `npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/hosted-inference.test.ts` - [x] `npx vitest run test/e2e-script-workflow.test.ts test/issue-5667-hosted-inference-model-namespace.test.ts src/lib/inference/onboard-probes.test.ts src/lib/onboard/providers.test.ts` - [x] `git diff --check` - [ ] hosted/public selective E2E workflow, if required by classification: not required; support-test-only PR, no live/workflow behavior changed. ## Follow-ups / waivers - Pre-push full `Test (CLI)` / `Test (plugin)` hooks were not clean on local macOS after the commit: CLI run hit existing macOS/stat/OOM-style failures; plugin run could not import package `json5`. Focused target tests above passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded end-to-end coverage for hosted inference compatibility and model ID/model precedence behavior. * Added validations for environment variable staging rules and shell mode behavior across NVAPI key scenarios. * Introduced a fake OpenAI-compatible server and added contract checks for `/models`, auth-required flows, and streamed responses on chat/response endpoints, including cleanup after runs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary Restore issue NVIDIA#5800 parity package `P0-A` for merged bash-suite inference-helper deltas only. This is a focused support-test parity PR: the helper/product behavior already exists on `main`; this adds missing Vitest assertions so shell retirement keeps the hosted/hermetic inference contracts covered. ## Related Issues Refs NVIDIA#5800 Refs NVIDIA#5098 Refs NVIDIA#5373 Refs NVIDIA#5374 Refs NVIDIA#5385 Refs NVIDIA#5395 Refs NVIDIA#5399 Refs NVIDIA#5400 Refs NVIDIA#5411 Refs NVIDIA#5751 Refs NVIDIA#5672 Refs NVIDIA#5757 ## Scope gate - Package: `P0-A — Hosted/hermetic inference helper parity` - Included PRs all merged and touched `test/e2e`: yes - Out of scope: unmerged/non-bash PRs; product cleanup; shell lane retirement / PR NVIDIA#5756 cleanup ## Parity map | ID | Source PR | Contract | Inference classification | Vitest assertion / waiver | Status | | --- | --- | --- | --- | --- | --- | | A1 | NVIDIA#5373 | Fake OpenAI-compatible helper supports `/models`, chat completions, responses API, auth checking, and request capture. | `hermetic-default` | `test/e2e-scenario/support-tests/hosted-inference.test.ts` starts `startFakeOpenAiCompatibleServer` and asserts models/chat/responses/request log behavior. | covered | | A2 | NVIDIA#5374, NVIDIA#5385, NVIDIA#5395 | Hosted CI inference stages `NVIDIA_INFERENCE_API_KEY` as `COMPATIBLE_API_KEY`, routes as `custom`/`compatible-endpoint`, and prefers `openai-completions`. | `hosted-compatible capable` | Existing workflow/helper assertions plus new shell helper staging assertion in `hosted-inference.test.ts`. | covered | | A3 | NVIDIA#5399, NVIDIA#5751, NVIDIA#5672, NVIDIA#5757 | Hosted model default remains the Inference Hub provider/namespace/model ID `nvidia/nvidia/nemotron-3-ultra`; explicit `NEMOCLAW_MODEL` takes precedence over `NEMOCLAW_COMPAT_MODEL`, which takes precedence over helper options/default. | `hosted-compatible capable` | New `requireHostedInferenceConfig` model precedence/default assertion; existing workflow/model namespace tests remain green. | covered | | A4 | NVIDIA#5400, NVIDIA#5411 | Hosted reachability probe is bounded and low-cost: no `/models`, chat completions, auth header, or bearer token spend. | `hosted-compatible capable` | Existing probe tests retained and revalidated. | covered | | A5 | NVIDIA#5385 | Public NVIDIA/nvapi shell mode remains distinct from hosted-compatible mode and is not restaged as compatible inference. | `public-nvidia required` | New shell helper assertion checks `nvapi-*` + `cloud` keeps `nvidia-prod`, leaves `COMPATIBLE_API_KEY` unset. | covered | ## Inference mode support - Default mode for touched live targets: none touched; this PR only changes support tests. - Real inference support preserved: yes, by asserting hosted-compatible and public-NVIDIA helper boundaries without invoking real inference. - Modes validated in this PR: hermetic fake endpoint and shell helper mocked hosted-compatible/public boundary. - If not validated with real inference: not required; no live target or hosted secret path changed. ## Validation - [x] `npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/hosted-inference.test.ts` - [x] `npx vitest run test/e2e-script-workflow.test.ts test/issue-5667-hosted-inference-model-namespace.test.ts src/lib/inference/onboard-probes.test.ts src/lib/onboard/providers.test.ts` - [x] `git diff --check` - [ ] hosted/public selective E2E workflow, if required by classification: not required; support-test-only PR, no live/workflow behavior changed. ## Follow-ups / waivers - Pre-push full `Test (CLI)` / `Test (plugin)` hooks were not clean on local macOS after the commit: CLI run hit existing macOS/stat/OOM-style failures; plugin run could not import package `json5`. Focused target tests above passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded end-to-end coverage for hosted inference compatibility and model ID/model precedence behavior. * Added validations for environment variable staging rules and shell mode behavior across NVAPI key scenarios. * Introduced a fake OpenAI-compatible server and added contract checks for `/models`, auth-required flows, and streamed responses on chat/response endpoints, including cleanup after runs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Changes the hosted inference E2E preflight from an authenticated chat completion to a lightweight HTTP reachability probe. This avoids spending model requests and tripping HTTP 429 during full parallel nightly runs before the scenario reaches the behavior under test.
Related Issue
Related to #5406 nightly follow-up.
Changes
test/e2e/lib/ci-compatible-inference.shsonemoclaw_e2e_probe_hosted_inferencechecks network/TLS reachability only and accepts any non-000 HTTP response./chat/completions.Type of Change
Verification
npx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Targeted verification:
npx biome check --write test/e2e-scenario/support-tests/hosted-inference.test.tsbash -n test/e2e/lib/ci-compatible-inference.shnpx vitest run --project cli test/e2e-scenario/support-tests/hosted-inference.test.tsDocs review: no user-facing docs changes needed; this is E2E harness stabilization only.
Note: local broad hooks still fail in unrelated runtime recovery preload tests because temp preload files are seen as group-writable (
mode=664), matching prior local hook failures. Targeted changed tests passed.Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Tests
Refactor