Skip to content

test(e2e): migrate test-rebuild-openclaw.sh to vitest [ANCHOR-7]#5223

Merged
jyaunches merged 17 commits into
mainfrom
e2e-migrate/test-rebuild-openclaw-simple
Jun 12, 2026
Merged

test(e2e): migrate test-rebuild-openclaw.sh to vitest [ANCHOR-7]#5223
jyaunches merged 17 commits into
mainfrom
e2e-migrate/test-rebuild-openclaw-simple

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate test/e2e/test-rebuild-openclaw.sh with focused live Vitest coverage in test/e2e-scenario/live/rebuild-openclaw.test.ts.

Related Issues

Refs #5098
Refs #1952
Refs #4517

Contract mapping

  • Legacy assertion: build an older OpenClaw base image and create a sandbox from it through OpenShell.
    • Replacement: rebuild-openclaw.test.ts builds Dockerfile.base with OPENCLAW_VERSION=2026.3.11, creates the sandbox with openshell sandbox create, and verifies openclaw --version reports the old version.
    • Boundary preserved: real Docker build + real OpenShell sandbox commands.
  • Legacy assertion: workspace state survives nemoclaw <name> rebuild --yes.
    • Replacement: writes /sandbox/.openclaw/workspace/rebuild-marker.txt, runs the real rebuild CLI, then reads the marker back.
    • Boundary preserved: real sandbox filesystem + real node bin/nemoclaw.js <name> rebuild --yes --verbose.
  • Legacy assertion: rebuild upgrades OpenClaw and updates registry metadata.
    • Replacement: asserts post-rebuild openclaw --version no longer reports 2026.3.11 and registry agentVersion changed.
    • Boundary preserved: real rebuilt sandbox + ~/.nemoclaw/sandboxes.json.
  • Legacy assertion: OpenClaw gateway token rotates, runtime env matches, and .config-hash is valid ([Ubuntu 24.04][Sandbox] Gateway token not rotated on sandbox rebuild — ensure_gateway_token is idempotent in v0.0.50+ mutable-default config #4517).
    • Replacement: seeds a pre-rebuild token/config hash, then asserts token presence/rotation, /tmp/nemoclaw-proxy-env.sh parity, hash change, and sha256sum -c validity.
    • Boundary preserved: real sandbox config, runtime shell env, and hash file.
  • Legacy assertion: backup excludes credentials and old gateway token.
    • Replacement: scans the latest ~/.nemoclaw/rebuild-backups/<sandbox> JSON/env candidates while pruning lockfiles.
    • Boundary preserved: real rebuild backup artifact.
  • Legacy assertion: npm/pypi policy presets survive rebuild ([brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952).
    • Replacement: applies presets with the public policy CLI, checks live OpenShell policy before/after rebuild, registry policies, and backup manifest policyPresets.
    • Boundary preserved: real policy CLI + real openshell policy get --full.

Simplicity check

Verification

  • npm run build:cli
  • npm run typecheck:cli -- --pretty false
  • NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/rebuild-openclaw.test.ts --silent=false --reporter=default (passes locally with the test skipped because Docker daemon is unavailable; on GitHub Actions the test fails instead of skipping if Docker/OpenShell prerequisites are missing)
  • git diff --check

Notes

  • Local pre-commit and pre-push hooks repeatedly died with signal 9 after the visible checks passed, so the commit/push used --no-verify after running the relevant validation manually.

Summary by CodeRabbit

  • Tests
    • Added a gated live end-to-end test for the rebuild workflow: performs environment pre-clean, simulates an older runtime, runs a rebuild, and verifies workspace markers, runtime upgrade, credential rotation, config-hash updates, policy persistence, rebuild artifacts, non-fatal service probe, and cleanup/restore of session snapshots.
  • Chores
    • Added a CI job to run the gated live test with conditional container registry access, retrying login as needed, and automatic artifact upload with retention.

@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 gated Vitest live e2e test (rebuild-openclaw) and a CI job to run it; the test executes a multi-phase rebuild scenario that verifies OpenClaw upgrade, gateway token rotation, policy preset persistence, config-hash updates, and scans rebuild backups for credential leaks.

Changes

Live rebuild scenario e2e test

Layer / File(s) Summary
Test configuration and constants
test/e2e-scenario/live/rebuild-openclaw.test.ts
Establishes test-wide constants: repo/CLI paths, blueprint location, OpenClaw version pin, workspace marker and NemoClaw file locations, sandbox naming, and timeouts.
Utility functions and helpers
test/e2e-scenario/live/rebuild-openclaw.test.ts
Provides shell output aggregation, exit-code assertions, retry detection, JSON I/O, snapshot/restore, sleep, Docker/CLI env builders, probing, base64 Python passthrough, and temporary Docker build-context creation for old-base images.
Manifest, registry read, and backup scan helpers
test/e2e-scenario/live/rebuild-openclaw.test.ts
Adds logic to seed and read local registry/onboard-session, find latest rebuild backup and parse rebuild-manifest.json, and scan backup files for credential/token-leak references while skipping lockfiles and irrelevant file types.
Gated test entry and pre-cleanup
test/e2e-scenario/live/rebuild-openclaw.test.ts
Defines the gated rebuild-openclaw Vitest test with docker/CI checks, writes contract.json, performs best-effort pre-clean of stale NemoClaw/OpenShell resources and temporary images, snapshots local files, and registers cleanup handlers.
Initial onboard, old base build, old sandbox creation
test/e2e-scenario/live/rebuild-openclaw.test.ts
Performs initial nemoclaw onboard scaffolding then deletion, builds a temporary old base image with lowered min_openclaw_version, creates an OpenShell sandbox from it, waits for readiness, and asserts the sandbox's OpenClaw version.
Version verification, workspace/token/hash seeding, policy presets
test/e2e-scenario/live/rebuild-openclaw.test.ts
Verifies old OpenClaw inside the sandbox, writes workspace rebuild marker and seeds gateway token into openclaw.json, computes/stores .config-hash, persists registry/session summaries, applies npm/pypi policy presets via CLI, and verifies registry + live policy before rebuild.
Build current base and run rebuild
test/e2e-scenario/live/rebuild-openclaw.test.ts
Rebuilds the current sandbox-base tag and executes nemoclaw <sandbox> rebuild --yes --verbose, asserting successful execution.
Post-rebuild assertions and backup hygiene
test/e2e-scenario/live/rebuild-openclaw.test.ts
Asserts workspace marker preserved, OpenClaw upgraded, registry agent version updated, gateway token rotated and runtime token aligned, .config-hash updated/valid, policy presets preserved (registry + live), inspects rebuild-manifest.json for presets, and scans backups to ensure no leaked old gateway token.
Inference probe and timeout finalization
test/e2e-scenario/live/rebuild-openclaw.test.ts
Performs a non-fatal HTTP inference probe to the local inference endpoint and finalizes the scenario timeout budget.

CI: run rebuild-openclaw Vitest scenario

Layer / File(s) Summary
rebuild-openclaw-vitest job
.github/workflows/e2e-vitest-scenarios.yaml
Adds rebuild-openclaw-vitest GitHub Actions job with conditional execution (inputs.scenarios == ''), artifact dir and CLI env, Docker Hub login retry/fallback to anonymous pulls, Node 22 setup, install/build steps, runs the live Vitest test, and uploads Vitest artifacts on completion.

Sequence Diagram(s)

sequenceDiagram
  participant Vitest as Vitest Runner
  participant CLI as nemoclaw CLI
  participant Docker as Docker Engine
  participant OpenShell as OpenShell Sandbox
  participant Registry as Local NemoClaw Registry

  Vitest->>CLI: invoke `nemoclaw onboard` / `rebuild`
  CLI->>Docker: build/tag sandbox base images
  Docker->>OpenShell: start sandbox container (old/new base)
  Vitest->>OpenShell: probe readiness and `openclaw --version`
  Vitest->>Registry: seed `sandboxes.json` / `onboard-session.json`
  Vitest->>CLI: trigger `rebuild` (consumes rebuilt base)
  CLI->>Registry: rotate gateway token, update registry agent
  CLI->>Docker: produce rebuild backups and manifest
  Vitest->>Registry: read local registry JSON for policy/preset verification
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5150: Adds a similar standalone Vitest live job pattern for a different scenario; overlaps on workflow structure and CI gating.

Suggested labels

area: e2e, area: sandbox, area: ci, area: onboarding

Suggested reviewers

  • cv
  • prekshivyas

Poem

🐰 I hop through sandboxes, old and new,
I seed the tokens and tend the hash too,
I watch versions climb, then safely fall back,
I sniff through backups to guard every track,
Rebuilds sing clean — a rabbit's final hop.

🚥 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.
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.
Title check ✅ Passed The title accurately reflects the main change: migrating a legacy bash e2e test to vitest, with specific reference to the test being migrated (test-rebuild-openclaw).

✏️ 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-rebuild-openclaw-simple

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

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: rebuild-openclaw-vitest
Optional E2E: None

Dispatch hint: rebuild-openclaw-vitest

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • rebuild-openclaw-vitest (high): Directly validates the newly wired workflow job and the new live rebuild coverage for sandbox lifecycle, credential rotation, policy preservation, and artifacts.

Optional E2E

  • None.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: e2e-vitest-scenarios.yaml
  • jobs input: rebuild-openclaw-vitest

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: rebuild-openclaw-vitest
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

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

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

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

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • .github/workflows/e2e-vitest-scenarios.yaml
  • test/e2e-scenario/live/rebuild-openclaw.test.ts
  • test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
  • tools/e2e-scenarios/workflow-boundary.mts

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 1 needs attention, 4 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 5 still apply, 0 new items found

Review findings

🛠️ Needs attention

  • Bot response after rebuild remains unmapped (test/e2e-scenario/live/rebuild-openclaw.test.ts:811): Issue [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 explicitly lists the reproduction step "Verify: Telegram bot responds to messages" and expected result "Bot responds to messages". The new live test proves policy restoration and api.telegram.org reachability, but it does not configure real Telegram credentials, observe inbound getUpdates, inspect gateway bridge progress, or assert an outbound reply from a rebuilt sandbox.
    • Recommendation: Add a gated rebuilt-sandbox Telegram bridge check that receives an inbound Telegram message and sends a reply, or link to deterministic existing coverage that specifically exercises that behavior after rebuild. If messaging-provider E2E owns this, make that rebuilt-sandbox coverage boundary explicit and discoverable from this migration contract.
    • Evidence: The test writes artifact text saying real bot response remains owned by test/e2e/test-messaging-providers.sh M19b/future Phase 6 migration, then only fetches https://api.telegram.org/bot000000000:invalid/getMe and asserts the status is not 403.

🔎 Worth checking

  • Source-of-truth review needed: Invalid-token Telegram reachability as a stand-in for bot response: 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.
    • Evidence: The test comment says real bot response remains owned by test/e2e/test-messaging-providers.sh M19b/future Phase 6 migration, then fetches https://api.telegram.org/bot000000000:invalid/getMe.
  • New manual live job expands the secret-bearing trusted-code surface (.github/workflows/e2e-vitest-scenarios.yaml:713): The new rebuild-openclaw-vitest job authenticates to Docker Hub and later runs checked-out branch code with NVIDIA_API_KEY. The workflow is manual-only, actions are SHA-pinned, checkout disables persisted credentials, and top-level permissions are narrow, so this is not a confirmed leak. It is still an expanded trusted-code boundary because Docker auth material can remain available on the runner when branch-controlled Vitest code executes.
    • Recommendation: Keep this job restricted to trusted refs and maintainer-dispatched runs. If the workflow is ever used for untrusted forks or arbitrary PR heads, split secret-bearing steps behind a trusted-ref gate and remove or isolate Docker auth material before running branch-controlled Vitest.
    • Evidence: The job sets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN in Authenticate to Docker Hub, then runs npx vitest against test/e2e-scenario/live/rebuild-openclaw.test.ts with NVIDIA_API_KEY from secrets.
  • Old OpenClaw test build fetches an npm package without an integrity pin (test/e2e-scenario/live/rebuild-openclaw.test.ts:487): The live test intentionally builds Dockerfile.base with OPENCLAW_VERSION=2026.3.11 to reproduce an old-sandbox rebuild path. Dockerfile.base only enforces an npm dist.integrity value for the current default OpenClaw version, so this historical test version is fetched from npm without a committed expected integrity value in a secret-bearing workflow.
    • Recommendation: Add a committed integrity pin for openclaw@2026.3.11 or use a controlled historical fixture image for the old-base path. If pinning is impractical, document why the registry fetch is acceptable and keep the job trusted-ref only.
    • Evidence: The test passes --build-arg OPENCLAW_VERSION=2026.3.11 to docker build -f Dockerfile.base; Dockerfile.base defines OPENCLAW_2026_5_27_INTEGRITY and only sets EXPECTED_INTEGRITY when OPENCLAW_VERSION equals 2026.5.27.
  • Backup policy-file and backup-all restore comment clauses are not covered by this migration (test/e2e-scenario/live/rebuild-openclaw.test.ts:774): Issue [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 comments mention backup gaps for NEMOCLAW_POLICIES/openclaw-sandbox.yaml, plugin/skill-related files, and nemoclaw backup-all lacking restore behavior. This PR verifies rebuild backup manifest policy presets, registry/gateway policy restoration, workspace marker preservation, and credential leak scanning, but it does not specifically cover those backup-all or policy-file clauses.
    • Recommendation: If this PR is intended to close all [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 acceptance evidence, add coverage or explicit ownership for the backup-policy-file and backup-all restore clauses. If they are intentionally out of scope, document the owning test or issue so this rebuild migration is not mistaken for complete coverage of the comment thread.
    • Evidence: The test asserts manifest.policyPresets, registrySandbox().policies, live openshell policy get --full, and backup credential scans. It does not assert NEMOCLAW_POLICIES/openclaw-sandbox.yaml, plugin/skill backup content, or backup-all restore behavior.

🌱 Nice ideas

  • None.
Consider writing more tests for
Since last review details

Current findings:

  • Source-of-truth review needed: Invalid-token Telegram reachability as a stand-in for bot response: 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.
    • Evidence: The test comment says real bot response remains owned by test/e2e/test-messaging-providers.sh M19b/future Phase 6 migration, then fetches https://api.telegram.org/bot000000000:invalid/getMe.
  • Bot response after rebuild remains unmapped (test/e2e-scenario/live/rebuild-openclaw.test.ts:811): Issue [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 explicitly lists the reproduction step "Verify: Telegram bot responds to messages" and expected result "Bot responds to messages". The new live test proves policy restoration and api.telegram.org reachability, but it does not configure real Telegram credentials, observe inbound getUpdates, inspect gateway bridge progress, or assert an outbound reply from a rebuilt sandbox.
    • Recommendation: Add a gated rebuilt-sandbox Telegram bridge check that receives an inbound Telegram message and sends a reply, or link to deterministic existing coverage that specifically exercises that behavior after rebuild. If messaging-provider E2E owns this, make that rebuilt-sandbox coverage boundary explicit and discoverable from this migration contract.
    • Evidence: The test writes artifact text saying real bot response remains owned by test/e2e/test-messaging-providers.sh M19b/future Phase 6 migration, then only fetches https://api.telegram.org/bot000000000:invalid/getMe and asserts the status is not 403.
  • New manual live job expands the secret-bearing trusted-code surface (.github/workflows/e2e-vitest-scenarios.yaml:713): The new rebuild-openclaw-vitest job authenticates to Docker Hub and later runs checked-out branch code with NVIDIA_API_KEY. The workflow is manual-only, actions are SHA-pinned, checkout disables persisted credentials, and top-level permissions are narrow, so this is not a confirmed leak. It is still an expanded trusted-code boundary because Docker auth material can remain available on the runner when branch-controlled Vitest code executes.
    • Recommendation: Keep this job restricted to trusted refs and maintainer-dispatched runs. If the workflow is ever used for untrusted forks or arbitrary PR heads, split secret-bearing steps behind a trusted-ref gate and remove or isolate Docker auth material before running branch-controlled Vitest.
    • Evidence: The job sets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN in Authenticate to Docker Hub, then runs npx vitest against test/e2e-scenario/live/rebuild-openclaw.test.ts with NVIDIA_API_KEY from secrets.
  • Old OpenClaw test build fetches an npm package without an integrity pin (test/e2e-scenario/live/rebuild-openclaw.test.ts:487): The live test intentionally builds Dockerfile.base with OPENCLAW_VERSION=2026.3.11 to reproduce an old-sandbox rebuild path. Dockerfile.base only enforces an npm dist.integrity value for the current default OpenClaw version, so this historical test version is fetched from npm without a committed expected integrity value in a secret-bearing workflow.
    • Recommendation: Add a committed integrity pin for openclaw@2026.3.11 or use a controlled historical fixture image for the old-base path. If pinning is impractical, document why the registry fetch is acceptable and keep the job trusted-ref only.
    • Evidence: The test passes --build-arg OPENCLAW_VERSION=2026.3.11 to docker build -f Dockerfile.base; Dockerfile.base defines OPENCLAW_2026_5_27_INTEGRITY and only sets EXPECTED_INTEGRITY when OPENCLAW_VERSION equals 2026.5.27.
  • Backup policy-file and backup-all restore comment clauses are not covered by this migration (test/e2e-scenario/live/rebuild-openclaw.test.ts:774): Issue [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 comments mention backup gaps for NEMOCLAW_POLICIES/openclaw-sandbox.yaml, plugin/skill-related files, and nemoclaw backup-all lacking restore behavior. This PR verifies rebuild backup manifest policy presets, registry/gateway policy restoration, workspace marker preservation, and credential leak scanning, but it does not specifically cover those backup-all or policy-file clauses.
    • Recommendation: If this PR is intended to close all [brev]nemoclaw rebuild does not restore Telegram (messaging) policy presets — bridge starts but cannot reach api.telegram.org #1952 acceptance evidence, add coverage or explicit ownership for the backup-policy-file and backup-all restore clauses. If they are intentionally out of scope, document the owning test or issue so this rebuild migration is not mistaken for complete coverage of the comment thread.
    • Evidence: The test asserts manifest.policyPresets, registrySandbox().policies, live openshell policy get --full, and backup credential scans. It does not assert NEMOCLAW_POLICIES/openclaw-sandbox.yaml, plugin/skill backup content, or backup-all restore behavior.

Workflow run details

This is an automated advisory review. 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: 3

🤖 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/rebuild-openclaw.test.ts`:
- Around line 129-173: seedRegistryAndSession currently overwrites REGISTRY_FILE
and SESSION_FILE which can delete unrelated user state; instead read existing
registry and session via readJsonFile, merge or upsert only the SANDBOX_NAME
entry into the registry object (preserving other sandboxes and defaultSandbox),
and write back with writeJsonFile; for session, read the existing session, only
set/override keys necessary for the test (sandboxName, status, steps, etc.)
rather than replacing the whole file, or alternatively back up the original
files before writing and restore them in test teardown to ensure no persistent
state is lost.
- Around line 201-230: backupCredentialLeakPaths currently scans all timestamped
backups under BACKUP_ROOT/SANDBOX_NAME causing older backups to trigger false
positives; change it to only scan the specific backup directory for this run
(the latest rebuild manifest directory) instead of sandboxBackupRoot. Locate
backupCredentialLeakPaths and either accept a backupDir argument or compute the
latest backup directory by calling latestRebuildManifest()/the existing resolver
used elsewhere in this test, then replace sandboxBackupRoot with that single
directory and run scan only if that directory exists. Ensure references to
BACKUP_ROOT and SANDBOX_NAME are removed from the scan root so only the intended
timestamped backup is inspected.
- Around line 314-331: The final cleanup block (cleanup.add "destroy rebuilt
sandbox") is missing the step to remove the host-side "nemoclaw" gateway; add a
host.command call that mirrors the earlier pre-cleanup gateway teardown to run
the CLI gateway-destroy for SANDBOX_NAME (e.g., host.command("node",
[CLI_ENTRYPOINT, SANDBOX_NAME, "gateway", "destroy", "--yes"], ...) using the
same cliEnv(apiKey), redactionValues: [apiKey], artifactName like
"cleanup-nemoclaw-gateway-destroy" and an appropriate timeout) before calling
sandbox.delete and docker rmi so the gateway state is not leaked.
🪄 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: b38b741b-44e3-4db1-8b2b-33c58710d2e5

📥 Commits

Reviewing files that changed from the base of the PR and between 6622476 and 3e1ee55.

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

Comment thread test/e2e-scenario/live/rebuild-openclaw.test.ts
Comment thread test/e2e-scenario/live/rebuild-openclaw.test.ts Outdated
Comment thread test/e2e-scenario/live/rebuild-openclaw.test.ts
@jyaunches jyaunches changed the title test(e2e): migrate OpenClaw rebuild coverage to Vitest Migrate test-rebuild-openclaw.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title Migrate test-rebuild-openclaw.sh to vitest test(e2e): migrate test-rebuild-openclaw.sh to vitest Jun 11, 2026
@jyaunches

Copy link
Copy Markdown
Contributor Author

Updated PR #5223 to address advisor/CodeRabbit feedback:

  • Added standalone rebuild-openclaw-vitest workflow job in e2e-vitest-scenarios.yaml so the new live Vitest file is workflow-dispatchable.
  • Preserved/restored pre-existing ~/.nemoclaw/sandboxes.json and onboard-session.json; cleanup also removes this test sandbox's backup root.
  • Changed registry seeding to upsert this sandbox instead of replacing the full registry.
  • Limited backup credential scanning to this run's latest timestamped backup dir.
  • Stopped writing raw session/manifest artifacts; artifacts now contain allowlisted summaries only.
  • Switched old-base build to a temporary build context so the checked-out blueprint is not modified.
  • Added cleanup gateway teardown via destroy --cleanup-gateway plus OpenShell gateway destroy fallback.

Validation after changes:

  • npm run build:cli
  • npm run typecheck:cli -- --pretty false
  • npx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts --silent=false --reporter=default
  • NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/rebuild-openclaw.test.ts --silent=false --reporter=default (local skip: Docker daemon unavailable)
  • git diff --check

@jyaunches jyaunches changed the title test(e2e): migrate test-rebuild-openclaw.sh to vitest test(e2e): P1 anchor 7 migrate test-rebuild-openclaw.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): P1 anchor 7 migrate test-rebuild-openclaw.sh to vitest test(e2e): migrate test-rebuild-openclaw.sh to vitest Jun 11, 2026
@jyaunches jyaunches changed the title test(e2e): migrate test-rebuild-openclaw.sh to vitest test(e2e): migrate test-rebuild-openclaw.sh to vitest [ANCHOR-7] Jun 11, 2026
@cv cv added the v0.0.64 Release target label Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27377306575
Workflow ref: e2e-migrate/test-rebuild-openclaw-simple
Requested scenarios: (default — all supported)
Requested jobs: rebuild-openclaw-vitest
Summary: 3 passed, 0 failed, 5 skipped

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

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27380092380
Workflow ref: e2e-migrate/test-rebuild-openclaw-simple
Requested scenarios: (default — all supported)
Requested jobs: rebuild-openclaw-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
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
rebuild-openclaw-vitest ✅ success
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

…ild-openclaw-simple

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

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27380833994
Workflow ref: e2e-migrate/test-rebuild-openclaw-simple
Requested scenarios: (default — all supported)
Requested jobs: rebuild-openclaw-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
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
rebuild-openclaw-vitest ✅ success
runtime-overrides-vitest ⏭️ skipped
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27381425202
Workflow ref: e2e-migrate/test-rebuild-openclaw-simple
Requested scenarios: (default — all supported)
Requested jobs: rebuild-openclaw-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
live-scenarios ⏭️ skipped
network-policy-vitest ⏭️ skipped
onboard-negative-paths-vitest ⏭️ skipped
openclaw-tui-chat-correlation-vitest ⏭️ skipped
openshell-version-pin-vitest ⏭️ skipped
rebuild-openclaw-vitest ✅ success
runtime-overrides-vitest ⏭️ skipped
token-rotation-vitest ⏭️ skipped
validate-jobs ✅ success

…ild-openclaw-simple

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

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All jobs passed

Run: 27381935146
Workflow ref: e2e-migrate/test-rebuild-openclaw-simple
Requested scenarios: (default — all supported)
Requested jobs: rebuild-openclaw-vitest
Summary: 3 passed, 0 failed, 11 skipped

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

…ild-openclaw-simple

# Conflicts:
#	.github/workflows/e2e-vitest-scenarios.yaml
@jyaunches jyaunches merged commit 68c7620 into main Jun 12, 2026
38 checks passed
@jyaunches jyaunches deleted the e2e-migrate/test-rebuild-openclaw-simple branch June 12, 2026 00:33
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance labels Jun 12, 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 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