Repository navigation
Description
Problem Statement
The E2E scenario migration currently has competing execution models:
- Implement layered E2E scenario model #3588 describes a layered E2E scenario model.
- Phase 1: Environment, Manifest, Fixture, and Runtime Action Primitives (E2E audit-coverage) #4347 through Phase 11: Final Audit Reconciliation (E2E audit-coverage) #4357 break that model into implementation phases.
- test(e2e): execute real shell assertions; delete dry-run, --validate-only, and the bash runner #4380 moves toward a TypeScript scenario runner as the live source of truth.
- test(e2e-scenario): delete obsolete run.ts framework, switch CI to run-scenario.sh #4379 points the other direction by removing the TypeScript runner and keeping the shell runner path.
- test(e2e): run onboarding assertions in scenario runner #4657 strengthens the YAML/bash runner by executing declared onboarding assertions.
- docs(e2e): clarify single-runner scenario target #4939 documents that the current hybrid state is transitional and that the end state should be a single runner with minimal shell.
After reviewing the current repo state, we should decide whether the “single runner” should be a custom NemoClaw E2E runner or an existing test runner with NemoClaw-specific fixtures.
The current repo already has Vitest projects in vitest.config.ts, including e2e-scenario-framework and e2e-branch-validation. Vitest also already provides the lifecycle primitives we would otherwise have to rebuild: test discovery, filtering, reporters, timeouts, skip behavior, per-test context, fixture setup/cleanup, scoped fixtures, and abort signals.
This issue proposes that we align on Vitest as the E2E scenario execution runner, with NemoClaw providing typed fixtures, clients, assertions, and migration inventory.
cc @jyaunches
Proposed Design
Use Vitest + NemoClaw E2E fixtures as the final E2E scenario framework.
In this model:
- Vitest owns test execution, lifecycle, filtering, reporters, timeout handling, and CI integration.
- NemoClaw owns the domain layer: scenario fixtures, sandbox/gateway/provider clients, redacted process execution, artifacts, secret handling, cleanup, external flake classification, and typed assertion helpers.
- Existing scenario metadata and assertion modules become migration inputs and fixture libraries, not a second runner.
- Shell scripts are retained only as temporary bridge probes or true system-boundary fixtures where shell is the natural interface.
- Legacy
test/e2e/test-*.shscripts are deleted only after equivalent Vitest scenarios are wired into the same CI lane with matching required secrets, skips, artifacts, and failure semantics.
A final-state scenario should look more like this:
import { test } from "../framework/e2e-test.ts";
test("ubuntu repo cloud OpenClaw", async ({
repo,
openclaw,
gateway,
sandbox,
inference,
}) => {
await repo.installCurrent();
const instance = await openclaw.onboard({
agent: "openclaw",
provider: "nvidia",
});
await gateway.expectHealthy(instance);
await sandbox.expectRunning(instance);
await inference.expectLocalChat(instance, { prompt: "Say ok.", expect: /ok/i });
});The shared fixture layer would live under test/e2e-scenario/framework/ or a similar path and expose fixtures such as:
artifactssecretshostrepoopenclawhermesgatewaysandboxinferenceprovidersnetworkPolicycleanup
The current TypeScript scenario code should be salvaged where useful:
test/e2e-scenario/scenarios/types.tsprovides useful vocabulary.test/e2e-scenario/scenarios/builder.tscan become typed test data or matrix helpers.test/e2e-scenario/scenarios/registry.tsand scenario definitions can continue to drive matrix generation.test/e2e-scenario/scenarios/clients/*andassertions/*can seed the fixture/domain helper layer.
The current YAML/bash execution path should not be expanded as the durable architecture:
test/e2e-scenario/runtime/run-scenario.shtest/e2e-scenario/runtime/run-suites.shtest/e2e-scenario/nemoclaw_scenarios/scenarios.yamltest/e2e-scenario/nemoclaw_scenarios/expected-states.yamltest/e2e-scenario/validation_suites/suites.yaml
Those files can remain during migration, but new architectural work should have an explicit path into Vitest fixtures/scenarios.
Migration Plan
1. Decision PR / docs alignment
Update #3588 and test/e2e-scenario/docs/ to state that the target is:
one E2E execution runner: Vitest, extended by NemoClaw fixtures and domain helpers.
Then clarify that #4347-#4357 are acceptance coverage phases, not requirements to build a YAML/bash runner.
2. Fixture skeleton
Add a new opt-in Vitest project, for example e2e-scenarios-live, gated by an environment variable so normal npm test remains fast and local-friendly.
Add:
test/e2e-scenario/framework/e2e-test.ts- fixture definitions using
test.extend - artifact capture and cleanup hooks
- secret loading/skipping helpers
- redacted command execution
- one migrated smoke scenario
3. Transitional bridge with a fuse
Allow a narrow helper such as shellProbe.run(...) for assertions that are expensive to port immediately. This should be treated as a bridge, not as a reason to keep authoring new shell suites.
Bridge helpers must:
- capture stdout/stderr/artifacts in Vitest output
- redact secrets
- support cleanup
- be associated with an owner/migration note
- be removed once the corresponding TypeScript helper exists
4. Family-by-family migration
Migrate behavior families, not files mechanically:
- Smoke/onboarding:
test-full-e2e.sh,test-cloud-onboard-e2e.sh,test-onboard-* - Inference: cloud inference, routing, OpenAI-compatible, Kimi, Bedrock, provider switching
- Messaging: split
test-messaging-providers.shinto Telegram, Discord, Slack, fake-provider, and token-rotation fixtures/scenarios - Sandbox lifecycle: rebuild, upgrade, backup/restore, crash-loop recovery, sandbox survival
- Security: credential sanitization, Telegram injection, network policy, shields
- Platform: Brev, WSL, macOS, GPU/Ollama stay special but still run through Vitest projects
5. Delete legacy entrypoints only after parity is proven
A legacy shell script is deletion-ready only when:
- equivalent Vitest coverage exists,
- it runs in the same relevant CI lane,
- required secrets/skips/runner requirements are preserved,
- artifacts are at least as useful as before,
- failure classification is not weaker,
- the migration inventory marks the old assertions as covered or intentionally retired.
Alternatives Considered
Build a custom TypeScript runner
This preserves the direction of #4380, but it duplicates core test-runner behavior that Vitest already provides. We would need to own discovery, filtering, reporters, cleanup semantics, skip behavior, concurrency, timeouts, CI output, and eventually fixture scopes.
Keep improving the YAML/bash runner
This is the direction #4657 strengthens. It is useful as a bridge and as requirements evidence, but it leaves us with a hybrid framework and makes shell/YAML the live execution authority. That conflicts with the desired end state of one runner and tests that rely on shell scripts as little as possible.
Keep both forever
This is the current accidental state. It makes the phase issues harder to interpret, encourages duplicate implementations, and makes it unclear when legacy E2E coverage can safely be retired.
Proposed Decisions
- Agree that Vitest is the final E2E scenario execution runner.
- Agree that NemoClaw builds fixtures/domain helpers, not a full custom runner.
- Agree that test(e2e): run onboarding assertions in scenario runner #4657 is unnecessary as durable architecture, though its assertion requirements can be ported.
- Agree that Phase 1: Environment, Manifest, Fixture, and Runtime Action Primitives (E2E audit-coverage) #4347-Phase 11: Final Audit Reconciliation (E2E audit-coverage) #4357 should be reinterpreted as acceptance/migration phases for Vitest fixtures and scenarios.
- Agree that new E2E scenario work should target Vitest fixtures unless it is explicitly marked as temporary bridge work.
Acceptance Criteria
- Implement layered E2E scenario model #3588 is updated or superseded to reflect the Vitest fixture-based target.
- Phase 1: Environment, Manifest, Fixture, and Runtime Action Primitives (E2E audit-coverage) #4347-Phase 11: Final Audit Reconciliation (E2E audit-coverage) #4357 include comments or edits clarifying that YAML/bash deliverables are not required as the final architecture.
- test(e2e): execute real shell assertions; delete dry-run, --validate-only, and the bash runner #4380, test(e2e-scenario): delete obsolete run.ts framework, switch CI to run-scenario.sh #4379, and test(e2e): run onboarding assertions in scenario runner #4657 have a clear disposition against this decision.
- A fixture skeleton PR adds the first live Vitest scenario using NemoClaw E2E fixtures.
- Migration docs define when a legacy shell test can be deleted.
- New scenario work has one obvious place to land.
Category
Testing
Checklist
- I searched existing issues and this is not a duplicate
- This is a design proposal, not a "please build this" request
Activity
cv commentedon Jun 8, 2026
Here is how I would implement this as a PR stack.
The stack should start with a linear foundation, then fan out into domain migrations. The goal is to avoid one huge PR that tries to settle the architecture, add fixture infrastructure, wire CI, and port the whole legacy suite at once.
Foundation stack
docs(e2e): choose Vitest fixtures as the scenario runnerUpdate
test/e2e-scenario/docs/README.mdandtest/e2e-scenario/docs/MIGRATION.mdfrom “single runner eventually” to “Vitest is the runner; NemoClaw provides fixtures.”This should also record the intended disposition for test(e2e): execute real shell assertions; delete dry-run, --validate-only, and the bash runner #4380, test(e2e-scenario): delete obsolete run.ts framework, switch CI to run-scenario.sh #4379, and test(e2e): run onboarding assertions in scenario runner #4657. docs(e2e): clarify single-runner scenario target #4939 is a good base, but this PR should name Vitest explicitly.
test(e2e): add live Vitest scenario projectAdd an opt-in
e2e-scenarios-liveproject tovitest.config.ts, disabled unless something likeNEMOCLAW_RUN_E2E_SCENARIOS=1is set.Keep
e2e-scenario-frameworkfor framework/unit tests.test(e2e): add scenario fixture contextAdd
test/e2e-scenario/framework/e2e-test.tswithtest.extendfixtures such as:artifactssecretscleanuphostshellProbeThis PR should be mostly hermetic: redaction tests, cleanup tests, artifact path tests, and skip-on-missing-secret tests.
test(e2e): add NemoClaw E2E clientsPort or salvage the current
test/e2e-scenario/scenarios/clients/*into fixture-friendly clients:No scenario migration yet. This PR should just give tests a typed API.
test(e2e): add first Vitest live smoke scenarioAdd the smallest real scenario, probably either:
ubuntu repo cli smoke, orubuntu repo cloud OpenClaw smoke, if we want to prove real onboarding immediately.It should prove install, artifact capture, cleanup, secret gating, and at least one real assertion.
ci(e2e): wire opt-in Vitest scenario workflowAdd or update workflow wiring so maintainers can run selected Vitest scenarios manually. Keep existing shell workflows untouched for now.
The important part is that artifacts and summaries are useful from day one.
test(e2e): add migration inventory and deletion gatesDefine the rule for when a legacy
test/e2e/test-*.shscript is deletion-ready.Add a machine-readable inventory mapping legacy scripts/assertions to one of:
Migration fan-out
After the foundation stack lands, these should branch from the foundation and can mostly proceed in parallel by domain.
Smoke/onboarding migration
Port
test-full-e2e.sh,test-cloud-onboard-e2e.sh,test-onboard-*, double-onboard, repair, resume, and negative paths.Inference migration
Port cloud inference, routing, provider switch, OpenAI-compatible, Kimi, Bedrock, and Ollama auth proxy coverage.
Messaging fixture migration
Convert fake Telegram/Discord/Slack helpers into TypeScript fixtures/providers. This should avoid exploding into all messaging scenarios immediately.
Messaging scenario migration
Break
test-messaging-providers.shinto separate Vitest scenarios for Telegram, Discord, Slack, token rotation, and Hermes variants.Security/policy migration
Port credential sanitization, Telegram injection, network policy, shields config, and secret-boundary checks.
Sandbox lifecycle migration
Port rebuild, upgrade, backup/restore, sandbox survival, crash-loop recovery, diagnostics, and snapshot commands.
Platform migration
Bring Brev, WSL, macOS, and GPU/Ollama under the same Vitest fixture model.
test/e2e/brev-e2e.test.tsis already Vitest, so this is more about replacing remote shell-suite dispatch with shared fixtures.Final cutover
ci(e2e): move nightly/regression lanes to Vitest scenariosChange the high-value CI lanes one by one, preserving secrets, skips, runner labels, timeouts, and artifacts.
test(e2e): deprecate YAML/bash scenario runnerMark
run-scenario.sh,run-suites.sh,scenarios.yaml,expected-states.yaml, and suite YAML as frozen/legacy.Add tests that prevent new durable coverage from landing there.
test(e2e): remove retired legacy E2E runner pathsDelete the YAML/bash scenario runner and any legacy shell scripts whose inventory rows are covered or intentionally retired.
Suggested merge discipline
PRs 1-7 should be stacked and merged in order.
PRs 8-14 can run in parallel once the fixture API is stable.
PRs 15-17 should wait until the migration inventory says we are not silently dropping coverage.
cv commentedon Jun 8, 2026
Draft implementation stack for the Vitest + fixtures direction discussed here. cc @jyaunches for review:
Verification on the rebased stack:
npm run build:cli && npm run typecheck:clinpx vitest run --project e2e-scenario-framework --silent=false --reporter=defaultNEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/ubuntu-repo-cli-smoke.test.ts --silent=false --reporter=defaultnpx prek run --all-filesnpm testdocs(e2e): choose Vitest fixtures as scenario runner (#4963)
test(e2e): add opt-in live scenario project (#4964)
jyaunches commentedon Jun 8, 2026
Companion design proposal in #4990 — proposes a phase-fixture layer above the CLI wrappers landed in #4965/#4966 so the matrix axes (platform/install/runtime/onboarding/lifecycle/suites) survive the migration to Vitest as composable fixtures, with
live/test discovery driven by the typed registry instead of one hand-authored file per scenario. Builds on the runner decision here, doesn't replace it.test(e2e): add scenario fixture context (#4965)
test(e2e): add fixture-friendly clients (#4966)
test(e2e): add first Vitest live smoke scenario (#4967)
3 remaining items
test(e2e): add environment phase fixture (#5002)
test(e2e): add onboarding phase fixture (#5003)
test(e2e): add state validation phase fixture (#5004)
test(e2e): discover live scenarios from registry (#5005)
ci(e2e): fan out Vitest scenarios from registry (#5006)
test(e2e): extend migration inventory to scenario runner internals (#…
test(e2e): add inference runtime helpers (#5056)
test(e2e): typed-shell-runner cutover (parity → retirement) (#5106)
cv commentedon Jun 10, 2026
Clarification after #5106
#5106 landed the important architectural outcome from this issue: Vitest is now the E2E execution runner, with NemoClaw-owned fixtures/helpers and GitHub Actions matrix fanout where fanout is useful. The retired typed-shell/YAML path should not come back as a second runner.
One point worth making explicit for follow-up work: the desired end state is not two categories of E2E tests, and it is not a new NemoClaw test framework layered on top of Vitest. The desired end state is one E2E system:
install.sh,.bashrc, process signals,/proc, sudo, Docker host state), the Vitest test should execute that real shell/system boundary. That does not require a separate bash E2E runner.So classifications in #5098 should be read as migration triage for the old
test/e2e/test-*.shcorpus, not as a decision to keep a parallel E2E architecture. “Keep the journey” is different from “keep the bash harness forever.” Full install → onboard → interact → cleanup flows are still valid E2E tests; they should live under the Vitest E2E system once migrated, with shell used only as the subprocess/fixture interface where shell is the contract.cv commentedon Jun 10, 2026
Follow-up path is now captured directly in the updated #5098 issue body: #5098
Key point for this issue: after #5106, #4941 architecture target is satisfied. Remaining work should proceed as one Vitest-driven E2E system, with shell used only as a real subprocess/system boundary inside Vitest tests where needed. We should avoid using
legacy-inventory.jsonas a second roadmap/source of truth; #5126 now uses deterministic workflow allowlists rather than a PR-body deletion-evidence contract.cv commentedon Jun 10, 2026
#5126 is now green and carries the follow-through for this issue: it removes the stale migration ledgers, renames the support-test surface away from framework/runner terminology, and adds a trusted PR Review Advisor check for retired E2E migration ledger reintroduction. The current source of truth is therefore: one Vitest-driven E2E system, fixtures/support helpers where useful, migration/deletion evidence in PR bodies and linked issues, no repo-local tracking ledger.\n\nRelated tracking is in #5098, with the latest guard note here: #5098 (comment)
cv commentedon Jun 10, 2026
#5126 now makes the architecture wording concrete in the repository layout: the shared E2E helper surface is
test/e2e-scenario/fixtures/, notframework/. The child draft migration PRs were refreshed accordingly, so new migration work should import fromfixtures/and keep Vitest as the only harness.test(e2e): failing-test-first guard for #2701 + recovery framework he…
cv commentedon Jun 17, 2026
Tracking in #5098