Repository navigation
refactor(e2e): centralize command result helpers - #6357
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR centralizes shared command result helpers in the E2E fixture, updates live tests and fixtures to import them, adds a few test-specific formatting helpers, and introduces coverage that blocks reintroducing local helper copies. ChangesShared command result helper adoption
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/live/diagnostics.test.ts (1)
31-41: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winCall
resultTextdirectly here.rawResultTextis the same[stdout, stderr].filter(Boolean).join("\n")wrapper over a compatible{ stdout, stderr }shape, so it only adds duplication and can slip past the name-based adoption guard.🤖 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/live/diagnostics.test.ts` around lines 31 - 41, Replace the redundant rawResultText helper with direct use of resultText in diagnostics.test.ts. The helper only wraps the same stdout/stderr join logic for a compatible result shape, so remove rawResultText and update the call sites/tests to pass the existing object into resultText instead. Use the resultText symbol as the single formatter wherever this text is needed.
🧹 Nitpick comments (1)
test/e2e/live/credential-sanitization.test.ts (1)
39-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueLeftover
CommandTexttype may now be unused.The local
resultText(result: CommandText)function that used this type was removed in favor of the importedresultText. ConfirmCommandTextstill has a consumer in this file; if not, remove it to avoid dead code.🤖 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/live/credential-sanitization.test.ts` at line 39, The local CommandText type in credential-sanitization.test.ts may now be dead code after switching to the imported resultText helper. Check whether any remaining references in this test file still use CommandText; if not, remove the type alias and keep the test using resultText directly, using the existing resultText and credential-sanitization test setup symbols to locate the change.
🤖 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/live/sandbox-operations.test.ts`:
- Line 16: The sandbox output check is duplicated in this test file, so switch
to the shared helper instead of maintaining a local copy. Import
outputContainsSandbox from ../fixtures/clients/command.ts alongside the existing
command fixtures, then remove the local outputContainsSandbox implementation and
update any call sites in sandbox-operations.test.ts to use the imported helper.
In `@test/e2e/support/e2e-command-helper-adoption.test.ts`:
- Around line 10-11: The LOCAL_COMMAND_HELPER guardrail regex is too narrow and
can miss reintroduced local copies of resultText/expectExitZero. Update the
pattern in the e2e-command-helper-adoption test to allow optional leading
whitespace, optional async before function, additional declaration kinds like
let/var, and typed const declarations so it still matches the helper names
regardless of common syntax variations.
---
Outside diff comments:
In `@test/e2e/live/diagnostics.test.ts`:
- Around line 31-41: Replace the redundant rawResultText helper with direct use
of resultText in diagnostics.test.ts. The helper only wraps the same
stdout/stderr join logic for a compatible result shape, so remove rawResultText
and update the call sites/tests to pass the existing object into resultText
instead. Use the resultText symbol as the single formatter wherever this text is
needed.
---
Nitpick comments:
In `@test/e2e/live/credential-sanitization.test.ts`:
- Line 39: The local CommandText type in credential-sanitization.test.ts may now
be dead code after switching to the imported resultText helper. Check whether
any remaining references in this test file still use CommandText; if not, remove
the type alias and keep the test using resultText directly, using the existing
resultText and credential-sanitization test setup symbols to locate the change.
🪄 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: ed8ca6a9-4d3e-43de-8064-a37dbf4f2e6a
📒 Files selected for processing (45)
test/e2e/fixtures/clients/command.tstest/e2e/fixtures/clients/index.tstest/e2e/fixtures/phases/onboarding.tstest/e2e/live/bedrock-runtime-compatible-anthropic.test.tstest/e2e/live/cloud-inference-provider-skip.tstest/e2e/live/cloud-inference.test.tstest/e2e/live/cloud-onboard.test.tstest/e2e/live/concurrent-gateway-ports.test.tstest/e2e/live/credential-migration.test.tstest/e2e/live/credential-sanitization.test.tstest/e2e/live/diagnostics.test.tstest/e2e/live/double-onboard.test.tstest/e2e/live/full-e2e.test.tstest/e2e/live/gpu-double-onboard.test.tstest/e2e/live/hermes-e2e.test.tstest/e2e/live/inference-routing.test.tstest/e2e/live/issue-4434-tui-unreachable-inference.test.tstest/e2e/live/issue-4462-scope-upgrade-approval.test.tstest/e2e/live/launchable-smoke.test.tstest/e2e/live/mcp-bridge-hermes-lifecycle.tstest/e2e/live/mcp-bridge.test.tstest/e2e/live/messaging-compatible-endpoint.test.tstest/e2e/live/messaging-providers-helpers.tstest/e2e/live/model-router-provider-routed-inference.test.tstest/e2e/live/network-policy-transient-provider.tstest/e2e/live/onboard-negative-paths.test.tstest/e2e/live/onboard-repair.test.tstest/e2e/live/openclaw-inference-switch.test.tstest/e2e/live/openclaw-plugin-runtime-exdev.test.tstest/e2e/live/openclaw-skill-cli.test.tstest/e2e/live/openshell-allowed-ips-rebinding.tstest/e2e/live/openshell-gateway-upgrade.test.tstest/e2e/live/phase6-messaging-helpers.tstest/e2e/live/rebuild-hermes.test.tstest/e2e/live/rebuild-openclaw.test.tstest/e2e/live/runtime-overrides.test.tstest/e2e/live/sandbox-operations.test.tstest/e2e/live/sandbox-rebuild.test.tstest/e2e/live/sandbox-rlimits-connect.test.tstest/e2e/live/shields-config.test.tstest/e2e/live/skill-agent.test.tstest/e2e/live/snapshot-commands.test.tstest/e2e/live/token-rotation.test.tstest/e2e/support/e2e-clients.test.tstest/e2e/support/e2e-command-helper-adoption.test.ts
da2b94b to
3c69e9b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/support/e2e-command-helper-adoption.test.ts`:
- Around line 13-19: The new conditional in typescriptFiles is tripping the
test-conditionals guardrail, so remove the explicit if statement inside the
flatMap callback. Refactor the logic in typescriptFiles to use a ternary
expression for entry.isDirectory() and keep the same recursive behavior for
directories and .ts file filtering, without introducing any additional if/else
statements.
🪄 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: bcb55a64-11ed-4964-bc81-87200d35a852
📒 Files selected for processing (45)
test/e2e/fixtures/clients/command.tstest/e2e/fixtures/clients/index.tstest/e2e/fixtures/phases/onboarding.tstest/e2e/live/bedrock-runtime-compatible-anthropic.test.tstest/e2e/live/cloud-inference-provider-skip.tstest/e2e/live/cloud-inference.test.tstest/e2e/live/cloud-onboard.test.tstest/e2e/live/concurrent-gateway-ports.test.tstest/e2e/live/credential-migration.test.tstest/e2e/live/credential-sanitization.test.tstest/e2e/live/diagnostics.test.tstest/e2e/live/double-onboard.test.tstest/e2e/live/full-e2e.test.tstest/e2e/live/gpu-double-onboard.test.tstest/e2e/live/hermes-e2e.test.tstest/e2e/live/inference-routing.test.tstest/e2e/live/issue-4434-tui-unreachable-inference.test.tstest/e2e/live/issue-4462-scope-upgrade-approval.test.tstest/e2e/live/launchable-smoke.test.tstest/e2e/live/mcp-bridge-hermes-lifecycle.tstest/e2e/live/mcp-bridge.test.tstest/e2e/live/messaging-compatible-endpoint.test.tstest/e2e/live/messaging-providers-helpers.tstest/e2e/live/model-router-provider-routed-inference.test.tstest/e2e/live/network-policy-transient-provider.tstest/e2e/live/onboard-negative-paths.test.tstest/e2e/live/onboard-repair.test.tstest/e2e/live/openclaw-inference-switch.test.tstest/e2e/live/openclaw-plugin-runtime-exdev.test.tstest/e2e/live/openclaw-skill-cli.test.tstest/e2e/live/openshell-allowed-ips-rebinding.tstest/e2e/live/openshell-gateway-upgrade.test.tstest/e2e/live/phase6-messaging-helpers.tstest/e2e/live/rebuild-hermes.test.tstest/e2e/live/rebuild-openclaw.test.tstest/e2e/live/runtime-overrides.test.tstest/e2e/live/sandbox-operations.test.tstest/e2e/live/sandbox-rebuild.test.tstest/e2e/live/sandbox-rlimits-connect.test.tstest/e2e/live/shields-config.test.tstest/e2e/live/skill-agent.test.tstest/e2e/live/snapshot-commands.test.tstest/e2e/live/token-rotation.test.tstest/e2e/support/e2e-clients.test.tstest/e2e/support/e2e-command-helper-adoption.test.ts
✅ Files skipped from review due to trivial changes (2)
- test/e2e/live/token-rotation.test.ts
- test/e2e/live/runtime-overrides.test.ts
🚧 Files skipped from review as they are similar to previous changes (42)
- test/e2e/live/gpu-double-onboard.test.ts
- test/e2e/live/issue-4462-scope-upgrade-approval.test.ts
- test/e2e/live/full-e2e.test.ts
- test/e2e/live/hermes-e2e.test.ts
- test/e2e/live/skill-agent.test.ts
- test/e2e/live/launchable-smoke.test.ts
- test/e2e/live/onboard-repair.test.ts
- test/e2e/live/openclaw-skill-cli.test.ts
- test/e2e/live/rebuild-hermes.test.ts
- test/e2e/support/e2e-clients.test.ts
- test/e2e/live/cloud-onboard.test.ts
- test/e2e/live/model-router-provider-routed-inference.test.ts
- test/e2e/live/concurrent-gateway-ports.test.ts
- test/e2e/live/openshell-allowed-ips-rebinding.ts
- test/e2e/live/inference-routing.test.ts
- test/e2e/fixtures/phases/onboarding.ts
- test/e2e/live/openshell-gateway-upgrade.test.ts
- test/e2e/live/bedrock-runtime-compatible-anthropic.test.ts
- test/e2e/live/cloud-inference.test.ts
- test/e2e/live/shields-config.test.ts
- test/e2e/live/openclaw-inference-switch.test.ts
- test/e2e/fixtures/clients/index.ts
- test/e2e/live/openclaw-plugin-runtime-exdev.test.ts
- test/e2e/live/cloud-inference-provider-skip.ts
- test/e2e/live/mcp-bridge-hermes-lifecycle.ts
- test/e2e/live/messaging-providers-helpers.ts
- test/e2e/fixtures/clients/command.ts
- test/e2e/live/double-onboard.test.ts
- test/e2e/live/sandbox-rebuild.test.ts
- test/e2e/live/network-policy-transient-provider.ts
- test/e2e/live/sandbox-rlimits-connect.test.ts
- test/e2e/live/snapshot-commands.test.ts
- test/e2e/live/onboard-negative-paths.test.ts
- test/e2e/live/mcp-bridge.test.ts
- test/e2e/live/phase6-messaging-helpers.ts
- test/e2e/live/diagnostics.test.ts
- test/e2e/live/messaging-compatible-endpoint.test.ts
- test/e2e/live/credential-sanitization.test.ts
- test/e2e/live/credential-migration.test.ts
- test/e2e/live/issue-4434-tui-unreachable-inference.test.ts
- test/e2e/live/rebuild-openclaw.test.ts
- test/e2e/live/sandbox-operations.test.ts
E2E Target Results — ❌ Some jobs failedRun: 28834837028
|
E2E Target Results — ❌ Some jobs failedRun: 28834837028
|
1 similar comment
E2E Target Results — ❌ Some jobs failedRun: 28834837028
|
E2E Target Results — ✅ All requested jobs passedRun: 28838472570
|
E2E Target Results — ✅ All requested jobs passedRun: 28838491985
|
E2E Target Results — ✅ All requested jobs passedRun: 28838513851
|
E2E Target Results — ✅ All requested jobs passedRun: 28838506346
|
E2E Target Results — ✅ All requested jobs passedRun: 28838521243
|
E2E Target Results — ❌ Some jobs failedRun: 28838499171
|
E2E Target Results — ❌ Some jobs failedRun: 28839573992
|
cv
left a comment
There was a problem hiding this comment.
Hard contributor-compliance gate: commit 3c69e9b is not marked Verified by GitHub. Every PR commit must appear Verified, and maintainers cannot repair or sign contributor history. Please replace it with a clean verified commit (or use a fresh branch/PR if the published branch cannot be safely rewritten), then rerun CI.
## Summary Extract the repeated synchronous file snapshot/restore and JSON state helpers used by the stateful rebuild E2E scenarios. The shared utility preserves the existing absent-file, empty-file, malformed-JSON, parent-directory, and formatted-newline behavior. ## Related Issue Closes #6348 Parent epic: #6346 ## Changes - Add a discriminated `FileSnapshot` type that cannot confuse an absent file with an empty one. - Add shared snapshot, restore, strict JSON read, missing-file fallback, parse-error fallback, and formatted JSON write helpers. - Keep malformed JSON behavior explicit through separate `readJsonFileOr` and `readJsonFileOrFallback` APIs. - Migrate rebuild-openclaw, rebuild-hermes, and stale-sandbox upgrade state handling. - Add focused support tests for absent, empty, populated, malformed, and nested-path cases. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [x] Docs not applicable — justification: test-state utility only - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed - [x] Targeted behavior tests pass — `e2e-file-state.test.ts` (3 passed) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed Additional local verification: - `npm run build:cli` - `npm run typecheck:cli` - `npm run lint` ## Advisor / Merge Coordination Notes - **Overlapping E2E refactor PRs:** PR #6358 and PR #6357 touch the same rebuild/stale-sandbox live test files. This PR should land first because it only extracts shared file-state helpers; the overlapping PRs can then rebase and keep using `test/e2e/fixtures/file-state.ts`. Any conflicts are expected to be mechanical import/helper-call conflicts, not runtime behavior conflicts. - **`readJsonFileOrFallback` semantics:** The malformed-JSON fallback is intentional only for stale-sandbox E2E setup state where prior test runs may leave incomplete registry/session JSON. The helper catches only `SyntaxError`; non-parse I/O/read failures still propagate, and `test/e2e/support/e2e-file-state.test.ts` covers that negative case. - **Sensitive-path waiver:** Changes are test-only under `test/e2e/**`; no production credential, policy, onboarding, inference, runner, sandbox runtime, or messaging code is modified. Maintainer approval by `cv` is recorded on this PR. --- Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added shared E2E file-state utilities for snapshot/restore and JSON read/write, with consistent pretty-printed JSON output and a trailing newline. * Introduced two JSON fallback behaviors: fallback only when a file is missing, or fallback when the file is missing and/or contains malformed JSON. * **Tests** * Added E2E coverage for restore behavior (absent vs. empty), nested directory handling for writes, and the JSON fallback/throw rules. * **Chores** * Updated multiple live E2E tests to reuse the shared file-state utilities instead of local helpers. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Maintainer waiver: commit-verification enforcement is waived for known team member jyaunches. Other CI, conflict, automated-review, security, and test gates still apply.
cv
left a comment
There was a problem hiding this comment.
Substantive review passed. All required checks are green and the trusted exact-head manual PR Review Advisor returned merge_as_is with high confidence and no findings. The lone unsigned commit belongs to jyaunches and is covered by the maintainer waiver for known team members.
) ## Summary Extract the repeated synchronous file snapshot/restore and JSON state helpers used by the stateful rebuild E2E scenarios. The shared utility preserves the existing absent-file, empty-file, malformed-JSON, parent-directory, and formatted-newline behavior. ## Related Issue Closes NVIDIA#6348 Parent epic: NVIDIA#6346 ## Changes - Add a discriminated `FileSnapshot` type that cannot confuse an absent file with an empty one. - Add shared snapshot, restore, strict JSON read, missing-file fallback, parse-error fallback, and formatted JSON write helpers. - Keep malformed JSON behavior explicit through separate `readJsonFileOr` and `readJsonFileOrFallback` APIs. - Migrate rebuild-openclaw, rebuild-hermes, and stale-sandbox upgrade state handling. - Add focused support tests for absent, empty, populated, malformed, and nested-path cases. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [x] Docs not applicable — justification: test-state utility only - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed - [x] Targeted behavior tests pass — `e2e-file-state.test.ts` (3 passed) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed Additional local verification: - `npm run build:cli` - `npm run typecheck:cli` - `npm run lint` ## Advisor / Merge Coordination Notes - **Overlapping E2E refactor PRs:** PR NVIDIA#6358 and PR NVIDIA#6357 touch the same rebuild/stale-sandbox live test files. This PR should land first because it only extracts shared file-state helpers; the overlapping PRs can then rebase and keep using `test/e2e/fixtures/file-state.ts`. Any conflicts are expected to be mechanical import/helper-call conflicts, not runtime behavior conflicts. - **`readJsonFileOrFallback` semantics:** The malformed-JSON fallback is intentional only for stale-sandbox E2E setup state where prior test runs may leave incomplete registry/session JSON. The helper catches only `SyntaxError`; non-parse I/O/read failures still propagate, and `test/e2e/support/e2e-file-state.test.ts` covers that negative case. - **Sensitive-path waiver:** Changes are test-only under `test/e2e/**`; no production credential, policy, onboarding, inference, runner, sandbox runtime, or messaging code is modified. Maintainer approval by `cv` is recorded on this PR. --- Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added shared E2E file-state utilities for snapshot/restore and JSON read/write, with consistent pretty-printed JSON output and a trailing newline. * Introduced two JSON fallback behaviors: fallback only when a file is missing, or fallback when the file is missing and/or contains malformed JSON. * **Tests** * Added E2E coverage for restore behavior (absent vs. empty), nested directory handling for writes, and the JSON fallback/throw rules. * **Chores** * Updated multiple live E2E tests to reuse the shared file-state utilities instead of local helpers. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary Centralize the live Vitest E2E command-result formatter and zero-exit assertion on the existing fixture client helpers. This removes the equivalent local helper copies exposed by the post-migration audit and adds a ratchet against reintroducing them. ## Related Issue Closes NVIDIA#6355 Parent epic: NVIDIA#6346 ## Changes - Generalize the shared command-result types so lightweight subprocess results can use `resultText` and `assertExitZero` without casts. - Replace equivalent local helpers across live targets and the onboarding phase with shared imports. - Preserve the existing Phase 6 helper APIs through re-exports while moving their implementation to the fixture client. - Rename the richer runtime-overrides spawn formatter instead of changing its intentionally different diagnostics. - Add an E2E support guard that rejects new local `resultText` or `expectExitZero` definitions in live targets. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: test-harness-only refactor with no user-facing behavior - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run --project e2e-support test/e2e/support/e2e-command-helper-adoption.test.ts test/e2e/support/e2e-clients.test.ts test/e2e/support/messaging-providers-runtime-proofs.test.ts test/e2e/support/openclaw-discord-pairing-helpers.test.ts` (79 passed) - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) Additional local verification: - `npm run build:cli` - `npm run typecheck` - `npm run lint` - Full `e2e-support` run reached 87 passing files; the unchanged main-branch shell-quote source-of-truth check currently reports `openshell-gateway-upgrade-helpers.ts`, and that test plus source file are unchanged by this PR. --- Signed-off-by: Julie Yaunches <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Standardized end-to-end command output formatting across flows for more consistent, readable failure messages. * Improved exit-status failure details by deriving them from unified command output and aligning accepted result shapes. * **Tests** * Updated many end-to-end tests to use shared command-result and exit-check helpers instead of local duplicates. * Added coverage for exit-check behavior with lightweight command results. * Added a guard test to prevent future live tests from reintroducing local helper implementations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Centralize the live Vitest E2E command-result formatter and zero-exit assertion on the existing fixture client helpers. This removes the equivalent local helper copies exposed by the post-migration audit and adds a ratchet against reintroducing them.
Related Issue
Closes #6355
Parent epic: #6346
Changes
resultTextandassertExitZerowithout casts.resultTextorexpectExitZerodefinitions in live targets.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project e2e-support test/e2e/support/e2e-command-helper-adoption.test.ts test/e2e/support/e2e-clients.test.ts test/e2e/support/messaging-providers-runtime-proofs.test.ts test/e2e/support/openclaw-discord-pairing-helpers.test.ts(79 passed)npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Additional local verification:
npm run build:clinpm run typechecknpm run linte2e-supportrun reached 87 passing files; the unchanged main-branch shell-quote source-of-truth check currently reportsopenshell-gateway-upgrade-helpers.ts, and that test plus source file are unchanged by this PR.Signed-off-by: Julie Yaunches [email protected]
Summary by CodeRabbit
Bug Fixes
Tests