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 branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 46%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: 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 AdvisorFindings: 0 needs attention, 3 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
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:
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 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>
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