Skip to content

test(e2e): document platform parity coverage for WSL GPU Spark - #5803

Closed
jyaunches wants to merge 2 commits into
mainfrom
e2e-parity/p0-e-platform-parity
Closed

jyaunches wants to merge 2 commits into
mainfrom
e2e-parity/p0-e-platform-parity

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restore issue #5800 parity package P0-E by documenting and pinning platform-aware Vitest coverage for WSL GPU, Docker Desktop gateway, Linux GPU toolkit preflight, DGX Spark DNS, and platform workflow routing.

Related Issues

Refs #5800
Refs #5098
Refs #5513 / #5536 / #5754
Refs #5512 / #5537 / #5538 / #5541
Refs #5489 / #5500 / #5529
Refs #5520 / #5539

Package scope

  • Package: P0-E — WSL/GPU/Spark platform parity or waiver package
  • Covers: WSL gateway host-gateway diagnostics, WSL GPU CDI-to---gpus compatibility fallback, missing toolkit remediation when nvidia-smi is unavailable but GPU context exists, DGX Spark DNS diagnostic-only behavior, and workflow selector boundaries for WSL/GPU/Spark/Jetson platform routes.
  • Out of scope: shell lane retirement / PR test(e2e): retire legacy shell lanes #5756 cleanup; production platform fixes from still-open source PRs.

Parity map

ID Source PR/issue Contract Inference classification Vitest assertion / waiver Status
E1 #5513 / #5536 / #5754 Docker Desktop WSL host-gateway probe failures must not be misreported as Linux bridge/UFW failures. none src/lib/onboard/gateway-sandbox-reachability.test.ts asserts host-gateway WSL message is retryable and has no UFW/127.0.0.1 guidance. covered
E2 #5512 / #5537 / #5538 Docker Desktop WSL may advertise CDI dirs but still needs Docker --gpus compatibility fallback when CDI injection is unresolvable. none src/lib/onboard/docker-gpu-patch-mode-selection.test.ts asserts CDI probe failure falls through to --gpus all; existing create-plan tests keep the GPU patch enabled and suppress direct OpenShell --gpu. covered
E3 #5512 / #5541 GPU recreate rollback/backup behavior is platform-sensitive and must not strand *-nemoclaw-gpu-backup-*. none Existing src/lib/onboard/docker-gpu-patch-rollback.test.ts and src/lib/onboard/docker-gpu-sandbox-create.test.ts cover deferred rollback/finalize behavior; no new assertion needed. covered
E4 #5489 / #5500 / #5529 Linux preflight must still block with install_nvidia_container_toolkit when nvidia-smi is unavailable but GPU/CDI context requires toolkit repair. none src/lib/onboard/preflight-cdi.test.ts asserts blocking toolkit action and nvidia-ctk cdi generate remediation. covered
E5 #5520 / #5539 DGX Spark DNS behavior is diagnostic-only unless host loopback resolver fallback provides an upstream; do not force host networking. none src/lib/onboard/docker-gpu-patch.test.ts asserts loopback resolver injects --dns, Spark-managed non-loopback DNS stays preserved, and no --network host is implied. covered
E6 #5512 / #5513 / #5520 platform runner validation WSL/GPU/Spark/Jetson selectors remain explicit and routable without claiming ubuntu-latest proves platform-only hardware behavior. none test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts asserts WSL registry routing and GPU/Spark/Jetson free-standing selector mappings; Jetson remains explicit-only. covered
E7 #5512 / #5513 / #5520 live hardware proof Real Windows Docker Desktop WSL GPU and DGX Spark DNS behavior cannot be proven on ubuntu-latest. none Waiver/follow-up: keep source platform issues open for NV QA/platform-owner validation; this PR pins the unit/workflow contracts that can run in normal CI. waived/follow-up

Inference mode support

  • Default mode for touched live targets: none (support/unit/workflow-boundary only; no live inference target edited).
  • Real inference support preserved: not applicable.
  • Modes validated in this PR: not applicable.
  • If not validated with real inference: package is platform routing/GPU/network setup; inference is incidental and not part of these assertions.

Validation

  • npm run build:cli
  • npx vitest run src/lib/onboard/gateway-sandbox-reachability.test.ts src/lib/onboard/docker-gpu-patch-mode-selection.test.ts src/lib/onboard/preflight-cdi.test.ts src/lib/onboard/docker-gpu-patch.test.ts test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts --reporter=default
  • git diff --check
  • hosted/public selective E2E workflow: not required; platform-only live proof remains in source issues/explicit selectors.

Follow-ups / waivers

Summary by CodeRabbit

  • Tests
    • Added coverage for GPU setup selection, including fallback behavior when CDI probing fails.
    • Expanded DNS-related checks to keep network settings consistent in loopback-only environments.
    • Improved gateway reachability messaging checks for WSL scenarios.
    • Added remediation coverage for NVIDIA toolkit installation and CDI guidance.
    • Extended end-to-end workflow boundary validation across platform and GPU/Spark/Jetson scenarios.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds test coverage for GPU/CDI fallback selection, Docker clone DNS injection, WSL sandbox reachability messaging, and workflow-boundary dispatch routing across canonical scenarios.

Changes

Onboarding and workflow parity tests

Layer / File(s) Summary
GPU/CDI selection and remediation
src/lib/onboard/docker-gpu-patch-mode-selection.test.ts, src/lib/onboard/preflight-cdi.test.ts
Adds coverage for CDI-probe fallback to --gpus all and for CDI remediation that stays blocked on install_nvidia_container_toolkit when GPU context exists.
Docker clone DNS and reachability
src/lib/onboard/docker-gpu-patch.test.ts, src/lib/onboard/gateway-sandbox-reachability.test.ts
Adds coverage for DNS argument selection in Docker clone args and for WSL host-gateway reachability messaging without UFW or loopback hints.
Workflow boundary parity
test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts
Adds imports plus tests for the wsl-repo-cloud-openclaw boundary configuration and explicit GPU/Spark/Jetson workflow dispatch routing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5613: Also updates E2E workflow boundary and dispatch selection coverage for Jetson/free-standing scenario routing.

Suggested labels

area: onboarding, area: e2e

Suggested reviewers

  • cv

Poem

🐇 I hopped through tests from dusk till dawn,
CDI and DNS both marched along.
WSL winds whispered, workflows ճիշտ,
and bunny routes stayed neat and snug.

🚥 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 PR’s main theme: documenting platform parity test coverage for WSL, GPU, and Spark behavior.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2e-parity/p0-e-platform-parity

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

@github-code-quality

github-code-quality Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the e2e-parity/p0-e-plat... 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-parity/p0-e-plat... 04336f8 +/-
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-parity/p0-e-plat... branch is 47%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main e2e-parity/p0-e-plat... 04336f8 +/-
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 — 71% —
src/lib/onboard/preflight.ts — 64% —
src/lib/actions...licy-channel.ts — 60% —
src/lib/state/sandbox.ts — 55% —
src/lib/onboard...er-gpu-patch.ts — 50% —
src/lib/policy/index.ts — 49% —
src/lib/onboard.ts — 19% —

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

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is required because this PR is tests-only. The changes add regression and workflow-boundary assertions but do not alter installer/onboarding runtime behavior, sandbox lifecycle code, credentials, network policy, inference routing, deployment logic, or real assistant user flows.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • None. The PR changes only unit/support test files and does not modify live Vitest scenario registry metadata, runtime support, manifests, fixtures, workflow machinery, free-standing live job wiring, or product code that would affect Vitest scenario behavior. No Vitest E2E scenario dispatch is required.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 1 test follow-up
Top item: No actionable code-review findings identified

Action checklist

  • PRA-T1 Add or justify test follow-up: Acceptance clause
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.

  • PRA-T1 Acceptance clause — No deterministic linked issue acceptance clauses were provided in the validation context; PR-body parity claims were treated as untrusted scope evidence only. — add test evidence or identify existing coverage. The validation context reported linkedIssues: []; the diff was still checked against the PR-body parity map and adds tests for WSL host-gateway diagnostics, CDI-to---gpus fallback, CDI toolkit remediation, DGX Spark DNS scoping, and E2E selector routing.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

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

Actionable comments posted: 2

🤖 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 `@src/lib/onboard/preflight-cdi.test.ts`:
- Around line 344-351: Update the test in preflight-cdi.test.ts so the title
matches the actual inputs driving planHostRemediation: it should describe the
install_nvidia_container_toolkit branch triggered by cdiNvidiaGpuSpecMissing and
nvidiaContainerToolkitInstalled being false, not nvidia-smi availability. Remove
the redundant hasNvidiaGpu: true override if baseAssessment already sets it, and
keep the assertion focused on the remediation action selected by
planHostRemediation.

In `@test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts`:
- Around line 15-25: The `wsl` lookup in `canonicalScenarios().find(...)` is
still treated as possibly undefined after `expect(wsl).toBeDefined()`, so the
later property access in the same test is not type-safe. In
`platform-parity-workflow-boundary.test.ts`, add an explicit runtime guard
immediately after the `expect(wsl).toBeDefined()` assertion in the
`wsl-repo-cloud-openclaw` block so TypeScript can narrow the value before
reading `environment`, `runnerRequirements`, `suiteIds`, and `requiredSecrets`.
🪄 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: 6b235d64-4548-43e0-a342-787a3906908c

📥 Commits

Reviewing files that changed from the base of the PR and between 3cedcbf and 04336f8.

📒 Files selected for processing (5)
  • src/lib/onboard/docker-gpu-patch-mode-selection.test.ts
  • src/lib/onboard/docker-gpu-patch.test.ts
  • src/lib/onboard/gateway-sandbox-reachability.test.ts
  • src/lib/onboard/preflight-cdi.test.ts
  • test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts

Comment on lines +344 to +351
it("still blocks with install_nvidia_container_toolkit when nvidia-smi is unavailable but PCI GPU context exists", () => {
const actions = planHostRemediation(
baseAssessment({
cdiNvidiaGpuSpecMissing: true,
hasNvidiaGpu: true,
nvidiaContainerToolkitInstalled: false,
}),
);

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Test title references nvidia-smi, but the assessment drives the branch via the toolkit flag.

The behavior being exercised is nvidiaContainerToolkitInstalled: false (plus cdiNvidiaGpuSpecMissing: true), which is what selects the install_nvidia_container_toolkit branch in planHostRemediation. The name "when nvidia-smi is unavailable" isn't modeled by any field here, so it may confuse the parity-coverage mapping this PR documents. Also, hasNvidiaGpu: true duplicates the baseAssessment default and can be dropped.

✏️ Suggested title/override tidy-up
-  it("still blocks with install_nvidia_container_toolkit when nvidia-smi is unavailable but PCI GPU context exists", () => {
+  it("still blocks with install_nvidia_container_toolkit when the toolkit is not installed but a GPU is present", () => {
     const actions = planHostRemediation(
       baseAssessment({
         cdiNvidiaGpuSpecMissing: true,
-        hasNvidiaGpu: true,
         nvidiaContainerToolkitInstalled: false,
       }),
     );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it("still blocks with install_nvidia_container_toolkit when nvidia-smi is unavailable but PCI GPU context exists", () => {
const actions = planHostRemediation(
baseAssessment({
cdiNvidiaGpuSpecMissing: true,
hasNvidiaGpu: true,
nvidiaContainerToolkitInstalled: false,
}),
);
it("still blocks with install_nvidia_container_toolkit when the toolkit is not installed but a GPU is present", () => {
const actions = planHostRemediation(
baseAssessment({
cdiNvidiaGpuSpecMissing: true,
nvidiaContainerToolkitInstalled: false,
}),
);
🤖 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 `@src/lib/onboard/preflight-cdi.test.ts` around lines 344 - 351, Update the
test in preflight-cdi.test.ts so the title matches the actual inputs driving
planHostRemediation: it should describe the install_nvidia_container_toolkit
branch triggered by cdiNvidiaGpuSpecMissing and nvidiaContainerToolkitInstalled
being false, not nvidia-smi availability. Remove the redundant hasNvidiaGpu:
true override if baseAssessment already sets it, and keep the assertion focused
on the remediation action selected by planHostRemediation.

Comment on lines +15 to +25
const wsl = canonicalScenarios().find((entry) => entry.id === "wsl-repo-cloud-openclaw");
expect(wsl).toBeDefined();

expect(wsl.environment).toMatchObject({
platform: "wsl-local",
runtime: "docker-running",
onboarding: "cloud-openclaw",
});
expect(wsl.runnerRequirements).toEqual(expect.arrayContaining(["windows-latest", "wsl2"]));
expect(wsl.suiteIds).toContain("platform-wsl");
expect(wsl.requiredSecrets).toContain("NVIDIA_INFERENCE_API_KEY");

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.

🎯 Functional Correctness | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target test file and relevant TypeScript/Vitest context.
git ls-files 'test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts' 'tsconfig*.json' 'package.json' 'vitest.config.*' 'test/**/support-tests/*.test.ts' | sed 's#^`#FILE` #'

echo
echo "---- target file ----"
cat -n test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts

echo
echo "---- search for similar patterns ----"
rg -n "toBeDefined\(\).*possible|expect\\(.*\\)\\.toBeDefined\\(\\).*\\n.*if \\(!.*\\)" test src -U || true

echo
echo "---- search for config / test runner deps ----"
rg -n "\"vitest\"|expectTypeOf|toBeDefined" package.json tsconfig*.json vitest.config.* test -g '!**/node_modules/**' || true

Repository: NVIDIA/NemoClaw

Length of output: 50371


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the file and typecheck-relevant configuration in smaller slices if needed.
stat -c '%n %s bytes' test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts
echo
sed -n '1,220p' test/e2e-scenario/support-tests/platform-parity-workflow-boundary.test.ts

echo
echo "---- tsconfig files ----"
for f in tsconfig*.json; do
  [ -f "$f" ] && echo "### $f" && cat "$f" && echo
done

echo
echo "---- package.json snippets ----"
sed -n '1,240p' package.json

Repository: NVIDIA/NemoClaw

Length of output: 195


Add a runtime guard before dereferencing wsl.
expect(wsl).toBeDefined() doesn’t narrow the find() result for TypeScript, so the later property reads still fail type-checking. Add if (!wsl) throw new Error("Missing canonical scenario: wsl-repo-cloud-openclaw"); after the expectation.

🧰 Tools
🪛 GitHub Check: build-typecheck

[failure] 25-25:
'wsl' is possibly 'undefined'.


[failure] 24-24:
'wsl' is possibly 'undefined'.


[failure] 23-23:
'wsl' is possibly 'undefined'.


[failure] 18-18:
'wsl' is possibly 'undefined'.

🤖 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/support-tests/platform-parity-workflow-boundary.test.ts`
around lines 15 - 25, The `wsl` lookup in `canonicalScenarios().find(...)` is
still treated as possibly undefined after `expect(wsl).toBeDefined()`, so the
later property access in the same test is not type-safe. In
`platform-parity-workflow-boundary.test.ts`, add an explicit runtime guard
immediately after the `expect(wsl).toBeDefined()` assertion in the
`wsl-repo-cloud-openclaw` block so TypeScript can narrow the value before
reading `environment`, `runnerRequirements`, `suiteIds`, and `requiredSecrets`.

Source: Linters/SAST tools

@jyaunches

Copy link
Copy Markdown
Contributor Author

Closing because P0-E source PRs referenced by issue #5800 are still open/unmerged, so this PR overclaims parity coverage. We'll reopen a scoped parity/waiver PR after the source scope is settled.

@jyaunches

Copy link
Copy Markdown
Contributor Author

Closing P0-E because the source PRs referenced by issue #5800 are still open/unmerged, so this PR overclaims parity coverage. We'll reopen a scoped parity/waiver PR after the P0-E source scope is settled.

@jyaunches jyaunches closed this Jun 25, 2026
@jyaunches
jyaunches deleted the e2e-parity/p0-e-platform-parity branch June 25, 2026 15:54
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow chore Build, CI, dependency, or tooling maintenance platform: dgx-spark Affects DGX Spark hardware or workflows platform: jetson Affects Jetson AGX Thor or Orin platform: wsl Affects Windows Subsystem for Linux labels Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow chore Build, CI, dependency, or tooling maintenance platform: dgx-spark Affects DGX Spark hardware or workflows platform: jetson Affects Jetson AGX Thor or Orin platform: wsl Affects Windows Subsystem for Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants