Skip to content

test(e2e): migrate test-launchable-smoke.sh to vitest [ANCHOR-8]#5219

Merged
jyaunches merged 9 commits into
NVIDIA:mainfrom
jyaunches:e2e-migrate/test-launchable-smoke
Jun 11, 2026
Merged

test(e2e): migrate test-launchable-smoke.sh to vitest [ANCHOR-8]#5219
jyaunches merged 9 commits into
NVIDIA:mainfrom
jyaunches:e2e-migrate/test-launchable-smoke

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate test/e2e/test-launchable-smoke.sh with the simplest equivalent live Vitest coverage.

Related Issues

Refs #5098
Refs #2599

Contract mapping

  • Legacy assertion: launchable bootstrap path runs scripts/brev-launchable-ci-cpu.sh against the current checkout via a pre-seeded clone.
    • Replacement: test/e2e-scenario/live/launchable-smoke.test.ts runs sudo -E bash scripts/brev-launchable-ci-cpu.sh with NEMOCLAW_CLONE_DIR pointed at a seeded local clone.
    • Boundary preserved: real Ubuntu shell script, sudo, Docker, Node/OpenShell install checks, sentinel file, repo/plugin build artifacts.
  • Legacy assertion: launchable-installed nemoclaw onboard --non-interactive creates a cloud OpenClaw sandbox.
    • Replacement: Vitest invokes the launchable-installed nemoclaw from the clone directory with NVIDIA_API_KEY, NEMOCLAW_SANDBOX_NAME, NEMOCLAW_RECREATE_SANDBOX=1, and the workflow-provided live model.
    • Boundary preserved: real CLI/onboard/OpenShell/Docker sandbox path.
  • Legacy assertion: sandbox health includes nemoclaw list, nemoclaw status, openshell inference get, and gateway container evidence.
    • Replacement: inline Vitest assertions over those same host commands; gateway container absence is a hard failure.
    • Boundary preserved: real host commands and Docker runtime.
  • Legacy assertion: direct NVIDIA Endpoints, sandbox inference.local, and openclaw agent --json --thinking off produce expected model responses.
    • Replacement: direct curl, sandbox curl, and sandbox OpenClaw agent probes assert PONG/42 with redacted artifacts.
    • Boundary preserved: live external API, OpenShell sandbox exec, inference.local routing, OpenClaw agent runtime.
  • Legacy assertion: sandbox and launchable clone cleanup completes.
    • Replacement: cleanup fixture destroys NemoClaw/OpenShell resources and removes the clone dir; final test checks registry removal.
    • Boundary preserved: real destroy/gateway cleanup commands.

Simplicity check

  • Test shape: simple live Vitest test.
  • Original runner/lane: .github/workflows/nightly-e2e.yaml job launchable-smoke-e2e on ubuntu-latest, requiring sudo, Docker/OpenShell, and NVIDIA_API_KEY.
  • Replacement runner: .github/workflows/e2e-vitest-scenarios.yaml job launchable-smoke-vitest on ubuntu-latest with the same sudo/Docker/OpenShell/NVIDIA_API_KEY resource class.
  • New shared helpers: none for the launchable contract; the test reuses the existing transient provider classifier added elsewhere on main to avoid failing the migration lane on upstream 429s.
  • New framework/registry/ledger: none.
  • Workflow changes: add/manual-preserve the launchable-smoke-vitest job in e2e-vitest-scenarios.yaml; legacy shell script deletion and nightly shell lane retirement are deferred to Epic: Migrate legacy bash E2E into the Vitest E2E system #5098 Phase 11.
  • Selective dispatch: gh workflow run e2e-vitest-scenarios.yaml --repo NVIDIA/NemoClaw --ref e2e-migrate/test-launchable-smoke -f jobs=launchable-smoke-vitest -f pr_number=5219.

Verification

  • NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/launchable-smoke.test.ts --silent=false --reporter=default (local run skips without live secret/environment)
  • npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts --silent=false --reporter=default
  • npx @biomejs/biome lint test/e2e-scenario/live/launchable-smoke.test.ts
  • npm run test-size:check
  • git diff --check
  • PR: test(e2e): migrate test-launchable-smoke.sh to vitest [ANCHOR-8] #5219
  • Same-runner selective run: https://github.com/NVIDIA/NemoClaw/actions/runs/27380701353launchable-smoke-vitest passed on ubuntu-latest at head 90a7e0a63f28ae76225d0828711b8815457c6994.

@coderabbitai

coderabbitai Bot commented Jun 11, 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 Vitest "launchable smoke" test and a CI job. The test runs the Ubuntu launchable install script, onboards a sandbox, verifies direct and sandbox-hosted inference (expects "PONG"), runs an OpenClaw agent interaction (expects "42"), and performs teardown and artifact upload. Workflow gains a jobs input and a dedicated job for this test.

Changes

Launchable E2E Smoke Test

Layer / File(s) Summary
Test config and constants
test/e2e-scenario/live/launchable-smoke.test.ts
Adds SPDX header and top-level constants: repo/script paths, sentinel path, model and sandbox names, timeouts, TypeScript shapes, and runEnv() helper.
Execution wrapper and parsers
test/e2e-scenario/live/launchable-smoke.test.ts
Implements runBash() with artifact capture, env redaction, timeout handling, expectExitZero(), and permissive JSON decoders for chat completions and OpenClaw agent payloads.
Clone lifecycle and cleanup helpers
test/e2e-scenario/live/launchable-smoke.test.ts
Implements preseedLaunchableClone() and cleanupLaunchableState() to create/remove a temp repo clone and best-effort destroy sandbox/gateway.
Inference retry and main live test
test/e2e-scenario/live/launchable-smoke.test.ts
Adds expectPongFromSandboxInference() with up to 3 retries and the main conditional launchable smoke test that runs the install script, onboards a sandbox, validates direct NVIDIA completions and sandbox-hosted inference (PONG), runs openclaw agent asserting reply contains 42, and performs teardown and artifact checks.
CI job and workflow inputs
.github/workflows/e2e-vitest-scenarios.yaml
Whitelists launchable-smoke-vitest in the allowed jobs list, adds a gated launchable-smoke-vitest job (dispatch input gating), configures NemoClaw sandbox env, optional Docker Hub login with retries, invokes the live Vitest test, and uploads e2e-artifacts/vitest/launchable-smoke/.

Sequence Diagram(s)

sequenceDiagram
  participant User as Workflow Trigger
  participant Actions as GitHub Actions
  participant Runner as GitHub Runner
  participant Vitest as launchable-smoke.test.ts
  participant Sandbox as NemoClaw Sandbox
  participant Artifacts as Artifact Storage

  User->>Actions: workflow_dispatch (inputs.jobs)
  Actions->>Runner: start launchable-smoke-vitest job
  Runner->>Vitest: run test/e2e-scenario/live/launchable-smoke.test.ts
  Vitest->>Sandbox: nemoclaw onboard / run sandboxed inference / openclaw agent
  Sandbox-->>Vitest: inference responses (PONG) and agent output (JSON containing 42)
  Vitest->>Artifacts: upload e2e-artifacts/vitest/launchable-smoke/
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5243: Adds related job-selector plumbing and report-to-pr wiring used by the new launchable-smoke-vitest job.

Suggested labels

area: e2e, area: ci, area: onboarding, area: inference

Suggested reviewers

  • cv
  • prekshivyas

Poem

🐰 I hopped the CI lane at dawn's first light,
Cloned a repo, ran installs through the night,
Sent PONG from sandboxes soft and keen,
Asked an agent, who answered: "42" — serene.
Logs tucked in artifacts, the garden sleeps tight.

🚥 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
Title check ✅ Passed The title clearly and concisely summarizes the main change: migrating a shell-based E2E smoke test to Vitest, with a ticket reference (ANCHOR-8).
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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 `@test/e2e-scenario/live/launchable-smoke.test.ts`:
- Around line 361-369: The gateway-container check currently uses "grep -E
'nemoclaw|openshell' || true" so runBash always succeeds and the test never
fails; update the runBash call (or its command) so it returns a non-zero exit
when no matching container is found (remove the "|| true" and/or use grep -q and
let runBash throw), then after capturing gatewayContainer, assert or throw if
gatewayContainer.stdout.trim().length === 0 (or set confirmed = false and call
throw/new Error) before writing artifacts; refer to the runBash invocation and
the gatewayContainer variable and artifacts.writeJson to locate where to
implement this failure behavior.
- Around line 28-34: The call to validateSandboxName(SANDBOX_NAME) runs at
module evaluation and should be moved inside the live-test gate so it only runs
when shouldRunLiveE2EScenarios() returns true; remove the top-level
validateSandboxName invocation and add a call to
validateSandboxName(SANDBOX_NAME) at the start of the gated block that checks
shouldRunLiveE2EScenarios(), ensuring SANDBOX_NAME remains declared as before
and that any subsequent code in that gated branch uses the validated value.
🪄 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: 7e0fcd2c-2771-4f3b-a64e-1c9306c2506f

📥 Commits

Reviewing files that changed from the base of the PR and between 6622476 and 11730c7.

📒 Files selected for processing (1)
  • test/e2e-scenario/live/launchable-smoke.test.ts

Comment thread test/e2e-scenario/live/launchable-smoke.test.ts Outdated
Comment thread test/e2e-scenario/live/launchable-smoke.test.ts
@jyaunches

Copy link
Copy Markdown
Contributor Author

/nvskills-ci

@jyaunches jyaunches force-pushed the e2e-migrate/test-launchable-smoke branch from 11730c7 to 10dde54 Compare June 11, 2026 13:07
@jyaunches jyaunches changed the title test(e2e): add launchable smoke Vitest coverage Migrate test-launchable-smoke.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title Migrate test-launchable-smoke.sh to vitest test(e2e): migrate test-launchable-smoke.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): migrate test-launchable-smoke.sh to vitest test(e2e): migrate launchable smoke to Vitest Jun 11, 2026
@jyaunches jyaunches force-pushed the e2e-migrate/test-launchable-smoke branch from 10dde54 to e78bb73 Compare June 11, 2026 13:27

@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 `@test/e2e-scenario/live/launchable-smoke.test.ts`:
- Line 28: The SANDBOX_NAME constant currently falls back to a static
"e2e-launchable" causing cross-run collisions; modify the initialization of
SANDBOX_NAME so that when process.env.NEMOCLAW_SANDBOX_NAME is unset you
generate a single per-process unique default (e.g., compute a uniqueSuffix once
using crypto.randomUUID() or Date.now()+Math.random and set SANDBOX_NAME =
`e2e-launchable-${uniqueSuffix}`) and reuse that constant for provisioning and
teardown so the same run uses the same name while explicit env overrides remain
unchanged.
- Around line 413-433: The test currently parses agent.stdout and checks for
"42" even if the process failed; update the test to assert the subprocess
succeeded first by checking agent.exitCode === 0 (e.g.
expect(agent.exitCode).toBe(0) with a helpful message including
stdout/stderr/rc) immediately after calling sandboxExec and before calling
parseAgentText; then proceed to parseAgentText(agent.stdout) and the existing
regex assertion. Target the sandboxExec result variable "agent" and the parse
function "parseAgentText".
🪄 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: 2745707e-09ff-4f6c-9690-d918b3e90c4e

📥 Commits

Reviewing files that changed from the base of the PR and between 10dde54 and e78bb73.

📒 Files selected for processing (2)
  • .github/workflows/e2e-vitest-scenarios.yaml
  • test/e2e-scenario/live/launchable-smoke.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e-vitest-scenarios.yaml

Comment thread test/e2e-scenario/live/launchable-smoke.test.ts Outdated
Comment thread test/e2e-scenario/live/launchable-smoke.test.ts
@jyaunches jyaunches force-pushed the e2e-migrate/test-launchable-smoke branch from e78bb73 to 14b38bd Compare June 11, 2026 13:39
@jyaunches jyaunches changed the title test(e2e): migrate launchable smoke to Vitest test(e2e): migrate test-launchable-smoke.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): migrate test-launchable-smoke.sh to vitest test(e2e): P1 anchor 8 migrate test-launchable-smoke.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): P1 anchor 8 migrate test-launchable-smoke.sh to vitest test(e2e): migrate test-launchable-smoke.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): migrate test-launchable-smoke.sh to vitest test(e2e): migrate test-launchable-smoke.sh to vitest [ANCHOR-8] Jun 11, 2026
@cv cv added the v0.0.64 Release target label Jun 11, 2026
…chable-smoke

# Conflicts:
#	.github/workflows/e2e-vitest-scenarios.yaml
…chable-smoke

# Conflicts:
#	.github/workflows/e2e-vitest-scenarios.yaml
@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ❌ Some jobs failed

Run: 27377259096
Workflow ref: e2e-migrate/test-launchable-smoke
Requested scenarios: (default — all supported)
Requested jobs: launchable-smoke-vitest
Summary: 2 passed, 1 failed, 5 skipped

Job Result
gateway-guard-recovery ⏭️ skipped
generate-matrix ✅ success
launchable-smoke-vitest ❌ failure
live-scenarios ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
validate-jobs ✅ success

Failed jobs: launchable-smoke-vitest. Check run artifacts for logs.

…chable-smoke

# Conflicts:
#	.github/workflows/e2e-vitest-scenarios.yaml
@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ❌ Some jobs failed

Run: 27379874314
Workflow ref: e2e-migrate/test-launchable-smoke
Requested scenarios: (default — all supported)
Requested jobs: launchable-smoke-vitest
Summary: 1 passed, 2 failed, 9 skipped

Job Result
credential-migration-vitest ⏭️ skipped
gateway-guard-recovery ⏭️ skipped
generate-matrix ❌ failure
hermes-e2e-vitest ⏭️ skipped
launchable-smoke-vitest ❌ failure
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

Failed jobs: generate-matrix, launchable-smoke-vitest. Check run artifacts for logs.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27380320994
Workflow ref: e2e-migrate/test-launchable-smoke
Requested scenarios: (default — all supported)
Requested jobs: launchable-smoke-vitest
Summary: 3 passed, 0 failed, 9 skipped

Job Result
credential-migration-vitest ⏭️ skipped
gateway-guard-recovery ⏭️ skipped
generate-matrix ✅ success
hermes-e2e-vitest ⏭️ skipped
launchable-smoke-vitest ✅ success
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

…chable-smoke

# Conflicts:
#	.github/workflows/e2e-vitest-scenarios.yaml
@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27380701353
Workflow ref: e2e-migrate/test-launchable-smoke
Requested scenarios: (default — all supported)
Requested jobs: launchable-smoke-vitest
Summary: 3 passed, 0 failed, 10 skipped

Job Result
credential-migration-vitest ⏭️ skipped
gateway-guard-recovery ⏭️ skipped
generate-matrix ✅ success
hermes-e2e-vitest ⏭️ skipped
launchable-smoke-vitest ✅ success
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
runtime-overrides-vitest ⏭️ skipped
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

@jyaunches jyaunches merged commit faab9f0 into NVIDIA:main Jun 11, 2026
48 checks passed
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 v0.0.64 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants