test(e2e): migrate GPU Ollama flow to vitest - #5556
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
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 Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review AdvisorAction expectation: Address required items before merge. Resolve or explicitly justify warnings. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. Review findings by urgency: 0 required fixes, 6 items to resolve/justify, 0 in-scope improvements🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a live GPU end-to-end Vitest test ( ChangesGPU E2E Ollama Scenario
Sequence DiagramsequenceDiagram
participant Test as gpu-e2e.test.ts
participant OllamaAPI as Ollama Local API
participant AuthProxy as Auth Proxy
participant SandboxInf as Sandbox Inference Endpoint
Test->>OllamaAPI: GET /api/tags (detect model)
OllamaAPI-->>Test: model list
Test->>OllamaAPI: POST /v1/chat/completions (PONG)
OllamaAPI-->>Test: response with PONG
Test->>AuthProxy: POST /v1/chat/completions with token (PONG)
AuthProxy->>SandboxInf: forward request
SandboxInf-->>AuthProxy: response with PONG
AuthProxy-->>Test: response with PONG
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 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 unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e-scenario/live/gpu-e2e.test.ts (1)
202-202: 💤 Low valueConsider a more defensive fallback if
HOMEis unset.If
process.env.HOMEis undefined, the path resolves to a relative.nemoclaw/ollama-proxy-token, which may not be the intended behavior. GPU runners should always haveHOMEset, but a fallback like/tmpor throwing an explicit error would be more defensive.- const tokenFile = path.join(process.env.HOME ?? "", ".nemoclaw", "ollama-proxy-token"); + const home = process.env.HOME; + if (!home) throw new Error("HOME environment variable is required"); + const tokenFile = path.join(home, ".nemoclaw", "ollama-proxy-token");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e-scenario/live/gpu-e2e.test.ts` at line 202, The tokenFile variable uses an empty string fallback when process.env.HOME is undefined, which results in a relative path rather than an absolute path. Instead of using an empty string as the fallback in the ternary operator, replace it with a defensive fallback like /tmp, or alternatively throw an explicit error to ensure the function fails fast if HOME is not set. This ensures the token file path is always absolute and the intent is clear if the environment is misconfigured.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/e2e-scenario/live/gpu-e2e.test.ts`:
- Line 202: The tokenFile variable uses an empty string fallback when
process.env.HOME is undefined, which results in a relative path rather than an
absolute path. Instead of using an empty string as the fallback in the ternary
operator, replace it with a defensive fallback like /tmp, or alternatively throw
an explicit error to ensure the function fails fast if HOME is not set. This
ensures the token file path is always absolute and the intent is clear if the
environment is misconfigured.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 973713fa-d0de-40ed-9e4e-394b972ba3ba
📒 Files selected for processing (2)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/live/gpu-e2e.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…2e-migrate/test-gpu-e2e Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…2e-migrate/test-gpu-e2e
|
Addressed the conflicts and several still-valid review items. Pushed updates:
Validation rerun: npx biome check --write test/e2e-scenario/live/gpu-e2e.test.ts test/e2e-scenario/live/gpu-e2e-helpers.ts .github/workflows/e2e-vitest-scenarios.yaml
npm run typecheck:cli
npx vitest run test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts test/e2e-scenario/support-tests/e2e-live-project-config.test.tsPush note: the default HTTPS token lacks |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Follow-up after the codebase-growth guard failure:
Validation rerun: npx biome check --write test/e2e-scenario/live/gpu-e2e.test.ts test/e2e-scenario/live/gpu-e2e-helpers.ts .github/workflows/e2e-vitest-scenarios.yaml
npm run typecheck:cli
npx vitest run test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts test/e2e-scenario/support-tests/e2e-live-project-config.test.ts |
# Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml
|
Merged latest Validation rerun after the conflict resolution: npx biome check --write .github/workflows/e2e-vitest-scenarios.yaml test/e2e-scenario/live/gpu-e2e.test.ts test/e2e-scenario/live/gpu-e2e-helpers.ts test/e2e-scenario/live/hermes-inference-switch.test.ts test/e2e-scenario/live/hermes-inference-switch-helpers.ts
npm run typecheck:cli
npx vitest run test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts test/e2e-scenario/support-tests/e2e-live-project-config.test.ts |
# Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml
|
Resolved the current merge conflict on PR #5556. Latest
and keeps each one wired into Validation rerun after resolving the conflict: npx biome check --write .github/workflows/e2e-vitest-scenarios.yaml test/e2e-scenario/live/gpu-e2e.test.ts test/e2e-scenario/live/gpu-e2e-helpers.ts test/e2e-scenario/live/agent-turn-latency.test.ts test/e2e-scenario/live/agent-turn-latency-helpers.ts test/e2e-scenario/live/kimi-inference-compat.test.ts test/e2e-scenario/live/kimi-inference-compat-helpers.ts
npm run typecheck:cli
npx vitest run test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts test/e2e-scenario/support-tests/e2e-live-project-config.test.tsPushed signed merge/update commits over SSH because the default HTTPS token cannot update workflow files. |
Summary
Migrates the GPU/Ollama E2E into a typed live Vitest scenario. The new test runs on the GPU runner, installs Ollama if needed, onboards with the Ollama provider, checks CUDA/GPU status and auth proxy behavior, then verifies direct Ollama and sandbox inference.local chat completions.
Related Issue
Refs #5098
Changes
test/e2e/test-gpu-e2e.sh..github/workflows/e2e-vitest-scenarios.yaml.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Targeted commands run:
npx biome check --write test/e2e-scenario/live/gpu-e2e.test.tsNEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/gpu-e2e.test.ts -t __compile_only_nomatch__ --silent=false --reporter=default --passWithNoTestsnpx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tsnpx tsx scripts/check-test-file-size-budget.ts test/e2e-scenario/live/gpu-e2e.test.tsnpx tsc --noEmit --strict --moduleResolution bundler --module preserve --target ES2022 --types node --allowImportingTsExtensions test/e2e-scenario/live/gpu-e2e.test.tsgit diff --checkSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Tests
CI/CD