Skip to content

test(e2e): migrate GPU Ollama flow to vitest - #5556

Merged
cv merged 20 commits into
mainfrom
e2e-migrate/test-gpu-e2e
Jun 21, 2026
Merged

test(e2e): migrate GPU Ollama flow to vitest#5556
cv merged 20 commits into
mainfrom
e2e-migrate/test-gpu-e2e

Conversation

@cv

@cv cv commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add a typed live Vitest replacement for test/e2e/test-gpu-e2e.sh.
  • Wire a free-standing dispatchable Vitest job into .github/workflows/e2e-vitest-scenarios.yaml.
  • Preserve legacy shell deletion and any legacy shell workflow cleanup for Phase 11 per Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 migration governance.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Targeted commands run:

  • npx biome check --write test/e2e-scenario/live/gpu-e2e.test.ts
  • NEMOCLAW_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 --passWithNoTests
  • npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
  • npx tsx scripts/check-test-file-size-budget.ts test/e2e-scenario/live/gpu-e2e.test.ts
  • npx tsc --noEmit --strict --moduleResolution bundler --module preserve --target ES2022 --types node --allowImportingTsExtensions test/e2e-scenario/live/gpu-e2e.test.ts
  • git diff --check

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests

    • Added a new live GPU end-to-end Vitest scenario with runner readiness checks, Ollama GPU provider install/verification, and best-effort cleanup.
    • Validates auth-proxy behavior for unauthenticated, wrong-token (rejected), and correct-token (allowed) requests.
    • Confirms chat connectivity by verifying “PONG” responses via both direct access and the sandbox inference endpoint.
    • Updated the workflow metadata test to use an explicit 60s timeout.
  • CI/CD

    • Added a standalone GPU E2E Vitest job (non-interactive) and included its results in PR reporting, with GPU E2E artifacts uploaded.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Jun 19, 2026
@github-code-quality

github-code-quality Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the e2e-migrate/test-gpu... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main e2e-migrate/test-gpu... f319658 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the e2e-migrate/test-gpu... branch is 46%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main e2e-migrate/test-gpu... f319658 +/-
src/lib/state/o...oard-session.ts 91%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 67%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 56%
src/lib/state/sandbox.ts 55%
src/lib/policy/index.ts 49%
src/lib/onboard...er-gpu-patch.ts 44%
src/lib/onboard.ts 18%

Updated June 21, 2026 21:12 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: gpu-e2e-vitest

Dispatch hint: gpu-e2e-vitest

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No merge-blocking E2E is required because the PR only adds E2E test code and workflow wiring; it does not change installer, onboarding, sandbox lifecycle, credentials, network policy, inference routing, deployment, or assistant runtime source behavior.

Optional E2E

  • gpu-e2e-vitest (high): Useful to validate the newly added GPU Ollama workflow job and live Vitest scenario on the intended GPU runner, but not merge-blocking for product runtime because the PR only changes E2E test/workflow files.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: .github/workflows/e2e-vitest-scenarios.yaml
  • jobs input: gpu-e2e-vitest

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: gpu-e2e-vitest
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=gpu-e2e-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • gpu-e2e-vitest: Focused free-standing Vitest job wired for changed live test test/e2e-scenario/live/gpu-e2e.test.ts.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=gpu-e2e-vitest

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • .github/workflows/e2e-vitest-scenarios.yaml
  • test/e2e-scenario/live/gpu-e2e-helpers.ts
  • test/e2e-scenario/live/gpu-e2e.test.ts

Comment thread test/e2e-scenario/live/gpu-e2e.test.ts Fixed
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Action 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.
Findings: 0 required fixes, 6 items to resolve/justify, 0 in-scope improvements
Since last review: 4 prior items resolved, 3 still apply, 0 new items found

Review findings by urgency: 0 required fixes, 6 items to resolve/justify, 0 in-scope improvements

🚨 Required before merge

Address these before merging unless a maintainer explicitly overrides the advisor with rationale.

  • None.

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

  • Source-of-truth review needed: Best-effort cleanup and pre-cleanup: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `bestEffort()` catches errors and logs warnings; `cleanupGpu()` wraps sandbox destroy/delete, gateway destroy, and Ollama/auth-proxy cleanup.
  • Source-of-truth review needed: Ollama remote installer compatibility path: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `ensureOllama()` runs `curl -fsSL https://ollama.com/install.sh | sh`; `scenario.json.remoteInstallerBoundary` documents the temporary boundary and intended replacement.
  • Source-of-truth review needed: Delegated legacy contracts for uninstall/model deletion and [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 TUI guard: The advisor marked localized patch analysis as missing.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `gpu-e2e.test.ts` writes `delegatedLegacyContracts`; legacy `test/e2e/test-gpu-e2e.sh` still contains the Phase 5.5 and Phase 6 checks.
  • Ollama installer is still executed as mutable remote code (test/e2e-scenario/live/gpu-e2e-helpers.ts:164): When `ollama` is absent, the live GPU scenario runs `curl -fsSL https://ollama.com/install.sh | sh`. The new workflow job has useful containment controls, including pinned actions, `persist-credentials: false`, top-level `contents: read`, `npm ci --ignore-scripts`, and no explicit repository secrets in the GPU job, but the installer payload remains unpinned and unverified remote code on a GPU/Docker runner.
    • Recommendation: Prefer installing a pinned Ollama release/package and verifying a checksum or signature before execution. If this scenario must intentionally exercise the official live installer, keep that trusted-code boundary explicit in code/workflow comments and ensure the job remains no-secrets/no-write-token.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `ensureOllama()` executes `curl -fsSL https://ollama.com/install.sh | sh`; the new `gpu-e2e-vitest` job adds no installer integrity check.
  • Best-effort cleanup still lacks a post-cleanup invariant (test/e2e-scenario/live/gpu-e2e-helpers.ts:52): The cleanup helper records warnings for non-zero cleanup commands and exceptions, which is better than silently swallowing failures, but it still proceeds without proving the runner is clean. On a reused or dirty live GPU runner, leftover sandbox registry entries, OpenShell sandboxes/gateways, Ollama servers, or auth-proxy processes could affect setup or make the scenario pass against stale state.
    • Recommendation: Keep tolerant handling for absent resources, but add a post-cleanup assertion or artifact that checks the sandbox registry no longer contains `SANDBOX_NAME`, OpenShell no longer lists/runs the sandbox, the `nemoclaw` gateway is absent/stopped, and no Ollama/auth-proxy listener remains on the expected ports.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `bestEffort()` logs cleanup failures; `cleanupGpu()` wraps sandbox destroy/delete, gateway destroy, and Ollama/auth-proxy cleanup. The legacy shell also directly checked `$HOME/.nemoclaw/sandboxes.json` after destroy.
  • Legacy uninstall/model-deletion and [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 TUI coverage remain delegated (test/e2e-scenario/live/gpu-e2e.test.ts:44): The new Vitest scenario is described as a replacement for `test/e2e/test-gpu-e2e.sh`, but it records delegated legacy contracts for `uninstall --delete-models` and the [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 OpenClaw TUI compaction guard instead of reproducing those executable checks. The retained shell still contains behavior that the new Vitest test does not cover, and no trusted linked issue clauses or comments were available in the deterministic context confirming that this delegation is acceptable.
    • Recommendation: Either add or identify retained trusted coverage for `uninstall.sh --yes --delete-models`, `$HOME/.nemoclaw` removal, the baked small-context compaction policy, and the real TUI first-turn guard, or link the exact trusted migration-governance clause that permits this scenario to delegate those contracts.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `scenario.json` writes `delegatedLegacyContracts`; legacy `test/e2e/test-gpu-e2e.sh` still contains Phase 5.5 [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 config/TUI checks and Phase 6 `uninstall.sh --yes --delete-models` plus `$HOME/.nemoclaw` removal checks.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • **Runtime validation** — `gpu-e2e` cleanup/pre-cleanup records cleanup failures and asserts the sandbox registry entry, OpenShell sandbox, gateway, Ollama server, and auth-proxy process are absent after cleanup.. The changed behavior depends on a real GPU runner, Docker, OpenShell installation, NemoClaw installer behavior, Ollama/model availability, auth-proxy lifecycle, and sandbox `inference.local` networking. Static support tests cover workflow selector metadata, but cannot prove the live runtime contracts.
  • **Runtime validation** — `gpu-e2e` retained or migrated coverage proves `uninstall.sh --yes --delete-models` completes and removes `$HOME/.nemoclaw`.. The changed behavior depends on a real GPU runner, Docker, OpenShell installation, NemoClaw installer behavior, Ollama/model availability, auth-proxy lifecycle, and sandbox `inference.local` networking. Static support tests cover workflow selector metadata, but cannot prove the live runtime contracts.
  • **Runtime validation** — `gpu-e2e` retained or migrated coverage proves the [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 baked small-context compaction policy and real OpenClaw TUI first turn do not fail with auto-compaction/context-limit errors.. The changed behavior depends on a real GPU runner, Docker, OpenShell installation, NemoClaw installer behavior, Ollama/model availability, auth-proxy lifecycle, and sandbox `inference.local` networking. Static support tests cover workflow selector metadata, but cannot prove the live runtime contracts.
  • **Runtime validation** — `gpu-e2e` proxy restart discovers the listener PID for `${PROXY_PORT}`, verifies `ps` args contain `ollama-auth-proxy`, kills only that PID, and proves the restarted proxy accepts the persisted token.. The changed behavior depends on a real GPU runner, Docker, OpenShell installation, NemoClaw installer behavior, Ollama/model availability, auth-proxy lifecycle, and sandbox `inference.local` networking. Static support tests cover workflow selector metadata, but cannot prove the live runtime contracts.
  • **Runtime validation** — `gpu-e2e-vitest` workflow selector `gpu-e2e` maps to `gpu-e2e-vitest` and `report-to-pr.needs` includes `gpu-e2e-vitest` through the free-standing inventory boundary tests.. The changed behavior depends on a real GPU runner, Docker, OpenShell installation, NemoClaw installer behavior, Ollama/model availability, auth-proxy lifecycle, and sandbox `inference.local` networking. Static support tests cover workflow selector metadata, but cannot prove the live runtime contracts.
  • **Best-effort cleanup and pre-cleanup** — Add a cleanup/pre-cleanup assertion that records cleanup failures and asserts the registry entry, OpenShell sandbox, gateway, Ollama listener, and auth-proxy listener are absent.. `bestEffort()` catches errors and logs warnings; `cleanupGpu()` wraps sandbox destroy/delete, gateway destroy, and Ollama/auth-proxy cleanup.
  • **Ollama remote installer compatibility path** — Install a pinned Ollama release/package with checksum/signature verification, or add a test/workflow assertion that the job only runs this live installer under the documented no-secrets/no-write-token boundary.. `ensureOllama()` runs `curl -fsSL https://ollama.com/install.sh | sh`; `scenario.json.remoteInstallerBoundary` documents the temporary boundary and intended replacement.
  • **Delegated legacy contracts for uninstall/model deletion and [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 TUI guard** — Retain or migrate executable coverage for `uninstall.sh --yes --delete-models`, `$HOME/.nemoclaw` removal, baked small-context compaction policy, and real OpenClaw TUI first turn.. `gpu-e2e.test.ts` writes `delegatedLegacyContracts`; legacy `test/e2e/test-gpu-e2e.sh` still contains the Phase 5.5 and Phase 6 checks.
Since last review details

Current findings, using the urgency labels above:

  • Source-of-truth review needed: Best-effort cleanup and pre-cleanup: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `bestEffort()` catches errors and logs warnings; `cleanupGpu()` wraps sandbox destroy/delete, gateway destroy, and Ollama/auth-proxy cleanup.
  • Source-of-truth review needed: Ollama remote installer compatibility path: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `ensureOllama()` runs `curl -fsSL https://ollama.com/install.sh | sh`; `scenario.json.remoteInstallerBoundary` documents the temporary boundary and intended replacement.
  • Source-of-truth review needed: Delegated legacy contracts for uninstall/model deletion and [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 TUI guard: The advisor marked localized patch analysis as missing.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `gpu-e2e.test.ts` writes `delegatedLegacyContracts`; legacy `test/e2e/test-gpu-e2e.sh` still contains the Phase 5.5 and Phase 6 checks.
  • Ollama installer is still executed as mutable remote code (test/e2e-scenario/live/gpu-e2e-helpers.ts:164): When `ollama` is absent, the live GPU scenario runs `curl -fsSL https://ollama.com/install.sh | sh`. The new workflow job has useful containment controls, including pinned actions, `persist-credentials: false`, top-level `contents: read`, `npm ci --ignore-scripts`, and no explicit repository secrets in the GPU job, but the installer payload remains unpinned and unverified remote code on a GPU/Docker runner.
    • Recommendation: Prefer installing a pinned Ollama release/package and verifying a checksum or signature before execution. If this scenario must intentionally exercise the official live installer, keep that trusted-code boundary explicit in code/workflow comments and ensure the job remains no-secrets/no-write-token.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `ensureOllama()` executes `curl -fsSL https://ollama.com/install.sh | sh`; the new `gpu-e2e-vitest` job adds no installer integrity check.
  • Best-effort cleanup still lacks a post-cleanup invariant (test/e2e-scenario/live/gpu-e2e-helpers.ts:52): The cleanup helper records warnings for non-zero cleanup commands and exceptions, which is better than silently swallowing failures, but it still proceeds without proving the runner is clean. On a reused or dirty live GPU runner, leftover sandbox registry entries, OpenShell sandboxes/gateways, Ollama servers, or auth-proxy processes could affect setup or make the scenario pass against stale state.
    • Recommendation: Keep tolerant handling for absent resources, but add a post-cleanup assertion or artifact that checks the sandbox registry no longer contains `SANDBOX_NAME`, OpenShell no longer lists/runs the sandbox, the `nemoclaw` gateway is absent/stopped, and no Ollama/auth-proxy listener remains on the expected ports.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `bestEffort()` logs cleanup failures; `cleanupGpu()` wraps sandbox destroy/delete, gateway destroy, and Ollama/auth-proxy cleanup. The legacy shell also directly checked `$HOME/.nemoclaw/sandboxes.json` after destroy.
  • Legacy uninstall/model-deletion and [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 TUI coverage remain delegated (test/e2e-scenario/live/gpu-e2e.test.ts:44): The new Vitest scenario is described as a replacement for `test/e2e/test-gpu-e2e.sh`, but it records delegated legacy contracts for `uninstall --delete-models` and the [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 OpenClaw TUI compaction guard instead of reproducing those executable checks. The retained shell still contains behavior that the new Vitest test does not cover, and no trusted linked issue clauses or comments were available in the deterministic context confirming that this delegation is acceptable.
    • Recommendation: Either add or identify retained trusted coverage for `uninstall.sh --yes --delete-models`, `$HOME/.nemoclaw` removal, the baked small-context compaction policy, and the real TUI first-turn guard, or link the exact trusted migration-governance clause that permits this scenario to delegate those contracts.
    • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
    • Evidence: `scenario.json` writes `delegatedLegacyContracts`; legacy `test/e2e/test-gpu-e2e.sh` still contains Phase 5.5 [Spark][Agent&Skills] OpenClaw auto-compaction prevents qwen2.5:0.5b responses via TUI on Local Ollama (GB10 Spark) #5468 config/TUI checks and Phase 6 `uninstall.sh --yes --delete-models` plus `$HOME/.nemoclaw` removal checks.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each finding. A human maintainer must make the final merge decision.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added the v0.0.66 label Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a live GPU end-to-end Vitest test (gpu-e2e.test.ts) that provisions an Ollama GPU provider, validates auth-proxy token authentication, and verifies inference via both the local Ollama API and the sandbox endpoint. A corresponding gpu-e2e-vitest CI job is added to the workflow with GPU runner targeting, and its result is included in the report-to-pr aggregation.

Changes

GPU E2E Ollama Scenario

Layer / File(s) Summary
Test harness setup and utility helpers
test/e2e-scenario/live/gpu-e2e.test.ts
Defines CLI path constants, environment variable defaults, env() composer, plus bestEffort(), readTokenFileChecked(), and chatContent() utilities.
Scenario wrapper, cleanup registration, and pre-cleanup
test/e2e-scenario/live/gpu-e2e.test.ts
Implements the skipIf-gated scenario block, writes a scenario.json artifact, registers cleanup for sandbox/gateway/host processes, and performs pre-cleanup before provisioning.
Prerequisite checks, Ollama install, and CLI status assertions
test/e2e-scenario/live/gpu-e2e.test.ts
Validates Docker and nvidia-smi, conditionally installs Ollama, stops existing services, runs install.sh, writes install log artifact, and asserts CLI status for CUDA and GPU-enabled markers.
Auth-proxy token validation and restart
test/e2e-scenario/live/gpu-e2e.test.ts
Reads proxy token with permission checks, verifies 401/200 HTTP responses for unauthenticated, wrong-token, and correct-token requests, then kills and restarts the auth proxy confirming continued 200 responses.
Ollama model detection and inference endpoint assertions
test/e2e-scenario/live/gpu-e2e.test.ts
Detects an Ollama model from the local API, sends PONG chat-completions requests directly to Ollama and via the sandbox inference endpoint, asserts both return PONG.
CI workflow job definition and test boundary integration
.github/workflows/e2e-vitest-scenarios.yaml, test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
Adds the gpu-e2e-vitest job with dispatch gating, GPU runner, Ollama environment config, test execution step, and artifact upload; extends report-to-pr.needs to fan in the new job; updates workflow boundary test timeout configuration and import formatting.

Sequence Diagram

sequenceDiagram
  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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5243: Both PRs modify .github/workflows/e2e-vitest-scenarios.yaml around the same free-standing Vitest job selector gating and report-to-pr dependency wiring, with the new gpu-e2e-vitest job aligning with the selector-based mechanism introduced in the retrieved PR.
  • NVIDIA/NemoClaw#5495: Both PRs modify .github/workflows/e2e-vitest-scenarios.yaml to add a GPU free-standing Vitest job and wire it into the report-to-pr job's needs table, with similarly structured Ollama/auth-proxy live tests in test/e2e-scenario/live/*.
  • NVIDIA/NemoClaw#5551: Both PRs add/extend live end-to-end coverage for the Ollama auth-proxy contract—token persistence, 401/200 enforcement, and proxy restart recovery (main: gpu-e2e.test.ts; retrieved: ollama-auth-proxy.test.ts).

Suggested labels

area: e2e

🐇 A GPU awaits, with tensors to flex,
The ollama roars and PONG echoes back!
Auth-proxy guards with tokens in check,
The sandbox spins up, no CUDA to lack.
This bunny tests inference — ears fully stacked! 🎮✨

🚥 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 summarizes the main change: migrating a GPU Ollama end-to-end test flow to Vitest, which is the primary objective of the PR.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2e-migrate/test-gpu-e2e

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/e2e-scenario/live/gpu-e2e.test.ts (1)

202-202: 💤 Low value

Consider a more defensive fallback if HOME is unset.

If process.env.HOME is undefined, the path resolves to a relative .nemoclaw/ollama-proxy-token, which may not be the intended behavior. GPU runners should always have HOME set, but a fallback like /tmp or 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d4d1f5 and d44b775.

📒 Files selected for processing (2)
  • .github/workflows/e2e-vitest-scenarios.yaml
  • test/e2e-scenario/live/gpu-e2e.test.ts

@cv cv linked an issue Jun 19, 2026 that may be closed by this pull request
79 tasks
cv added 3 commits June 19, 2026 14:07
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added 6 commits June 19, 2026 14:44
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>
Comment thread test/e2e-scenario/live/gpu-e2e.test.ts Fixed
Comment thread test/e2e-scenario/live/gpu-e2e.test.ts Fixed
@cv

cv commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the conflicts and several still-valid review items.

Pushed updates:

  • Merged latest origin/main into e2e-migrate/test-gpu-e2e to resolve the dirty merge state.
  • Made the GPU workflow fail fast if openshell is not found after install instead of exporting an empty OPENSHELL_BIN.
  • Made the token-file path fail fast when HOME is unset instead of constructing a relative path.
  • Changed proxy restart so the proxy token is passed via scoped environment, not argv, while preserving redaction.
  • Changed proxy restart to prefer killing the process listening on the proxy port after verifying its command line contains ollama-auth-proxy; fallback process matching now uses [o]llama-auth-proxy to avoid matching the helper shell.
  • Changed cleanup process matching to use self-excluding [o]llama... patterns.
  • Changed best-effort cleanup to emit labeled warnings for suppressed failures so cleanup issues are visible in test logs/artifacts.
  • Recorded the Ollama official-installer compatibility boundary in the scenario metadata: it runs before proxy tokens are read, under a read-only/no-explicit-repo-secrets workflow boundary, and should be replaced when a pinned GPU-runner install source is available.

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

Push note: the default HTTPS token lacks workflow scope for workflow file updates, so I pushed the same signed commits over SSH.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up after the codebase-growth guard failure:

  • Moved the HOME validation and token path construction into ollamaProxyTokenFile() in the helper module.
  • Removed the added if from the Vitest test body so the live test remains linear.

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
@cv

cv commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

Merged latest origin/main again after #5553 landed and resolved the workflow conflict by keeping both free-standing jobs (gpu-e2e-vitest and hermes-inference-switch-vitest) wired into report-to-pr.needs.

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
@cv

cv commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

Resolved the current merge conflict on PR #5556.

Latest origin/main brought in the agent-turn-latency and Kimi compatibility Vitest jobs plus PR review advisor changes. The conflict resolution keeps all free-standing E2E jobs in .github/workflows/e2e-vitest-scenarios.yaml:

  • gpu-e2e-vitest
  • agent-turn-latency-vitest
  • kimi-inference-compat-vitest
  • hermes-inference-switch-vitest

and keeps each one wired into report-to-pr.needs.

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.ts

Pushed signed merge/update commits over SSH because the default HTTPS token cannot update workflow files.

@cv
cv merged commit 7eb66cd into main Jun 21, 2026
40 checks passed
@cv
cv deleted the e2e-migrate/test-gpu-e2e branch June 21, 2026 21:41
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance provider: ollama Ollama local model provider behavior labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance provider: ollama Ollama local model provider behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants