test(e2e): migrate GPU double onboard to Vitest#5495
Conversation
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 new live Vitest E2E test file ( ChangesGPU Double-Onboard E2E Test and CI Job
Sequence Diagram(s)sequenceDiagram
participant Test as gpu-double-onboard.test.ts
participant CLI as nemoclaw CLI
participant Proxy as Ollama Auth Proxy
participant Sandbox as Docker/GPU Sandbox
Test->>Sandbox: docker info / nvidia-smi (check prerequisites)
Test->>CLI: install (Ollama service)
Test->>CLI: onboard (first time, non-interactive)
CLI->>Proxy: create and persist auth token
Proxy-->>Test: token file created with mode 600
Test->>Proxy: GET /v1/models with valid bearer token → 200
Test->>Proxy: GET /api/tags (any token) → numeric status
Test->>Proxy: GET /v1/models unauthenticated → 401
Test->>Proxy: GET /v1/models with wrong token → 401
Test->>Sandbox: curl inference.local chat completion (HTTPS)
Sandbox-->>Test: JSON response containing "42"
Test->>CLI: onboard again (sandbox recreation, same token expected)
Proxy-->>Test: token persisted with same content
Test->>Sandbox: curl inference.local chat completion (second time)
Sandbox-->>Test: JSON response containing "42"
Test->>CLI: cleanup (destroy sandbox, delete gateway, kill processes)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
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 |
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 AdvisorFindings: 1 needs attention, 7 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. |
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 |
Vitest E2E Scenario Results — ❌ Some jobs failedRun: 27629702812
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27631600832
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27632894484
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@test/e2e-scenario/live/gpu-double-onboard.test.ts`:
- Around line 208-223: The test currently validates only the new token
(tokenAfterSecond) without verifying it remains unchanged across the re-onboard
cycle, allowing a token rotation regression to pass undetected. Capture the
first token from TOKEN_FILE before the re-onboard operation (prior to line 208),
then add an explicit equality assertion comparing tokenAfterSecond to this first
captured token to enforce that the token identity is preserved across
re-onboard. Additionally, reuse the first token object for the post-reonboard
authentication check to validate the same token works for both requests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 04a46ee6-a453-4db3-82ba-edb219d47255
📒 Files selected for processing (2)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/live/gpu-double-onboard.test.ts
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27635624904
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27636905667
|
…double-onboard # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27638943887
|
…double-onboard # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/e2e-vitest-scenarios.yaml (1)
1939-1951:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd Docker Hub authentication to reduce GPU E2E flakiness.
This job skips the Docker Hub login guard used by most other live onboarding jobs in this workflow. On GPU runners, anonymous pull limits can make this scenario fail intermittently.
Suggested patch
gpu-double-onboard-vitest: @@ steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false + + - name: Authenticate to Docker Hub + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + shell: bash + run: | + set -euo pipefail + if [[ -z "${DOCKERHUB_USERNAME}" || -z "${DOCKERHUB_TOKEN}" ]]; then + echo "::notice::Docker Hub credentials not configured; continuing with anonymous pulls." + exit 0 + fi + login_succeeded=0 + for attempt in 1 2 3; do + if echo "${DOCKERHUB_TOKEN}" | timeout 30s docker login docker.io --username "${DOCKERHUB_USERNAME}" --password-stdin; then + login_succeeded=1 + break + fi + if [[ "$attempt" -lt 3 ]]; then + echo "::warning::Docker Hub login attempt ${attempt} failed; retrying." + sleep 5 + fi + done + if [[ "$login_succeeded" -ne 1 ]]; then + echo "::warning::Docker Hub login failed after 3 attempts; continuing with anonymous pulls." + fi🤖 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 @.github/workflows/e2e-vitest-scenarios.yaml around lines 1939 - 1951, Add Docker Hub authentication to this job to prevent intermittent pull failures on GPU runners due to anonymous rate limits. After the "Set up Node" step and before the "Install root dependencies" step, insert a new step that authenticates with Docker Hub using the docker/login-action GitHub Action with appropriate credentials. This aligns the authentication approach with other live onboarding jobs in the workflow that use the Docker Hub login guard.
🤖 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.
Outside diff comments:
In @.github/workflows/e2e-vitest-scenarios.yaml:
- Around line 1939-1951: Add Docker Hub authentication to this job to prevent
intermittent pull failures on GPU runners due to anonymous rate limits. After
the "Set up Node" step and before the "Install root dependencies" step, insert a
new step that authenticates with Docker Hub using the docker/login-action GitHub
Action with appropriate credentials. This aligns the authentication approach
with other live onboarding jobs in the workflow that use the Docker Hub login
guard.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d4b06322-5678-48f6-9007-13d5e18d990a
📒 Files selected for processing (1)
.github/workflows/e2e-vitest-scenarios.yaml
…double-onboard # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27649245791
|
Summary
Migrate
test-gpu-double-onboard.shinto the live Vitest E2E system. Addstest/e2e-scenario/live/gpu-double-onboard.test.tsandgpu-double-onboard-vitestworkflow wiring on the GPU runner. The Vitest test verifies GPU/Docker prerequisites, Ollama install, first onboard, persisted auth-proxy token, re-onboard, token consistency, auth rejection, sandbox inference, and cleanup.Related Issue
Refs #5098
Changes
gpu-double-onboard.gpu-double-onboard-vitestin.github/workflows/e2e-vitest-scenarios.yaml.test-gpu-double-onboard.shwhile leaving legacy shell retirement to Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 Phase 11.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 local checks run while preparing these branches:
npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts --silent=false --reporter=defaultnpm run typecheck:clifor branches adding new TypeScript testsgit diff --checkSelective same-runner dispatch: https://github.com/NVIDIA/NemoClaw/actions/runs/27649245791 — passed after merge-from-main refresh
Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit