test(e2e): migrate channels stop/start to Vitest#5580
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new free-standing live Vitest e2e scenario for Changeschannels-stop-start Live Vitest Scenario
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 46%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
Vitest E2E Scenario Results — ❌ Some jobs failedRun: 27959667575
|
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-scenario/live/phase6-messaging-helpers.ts`:
- Around line 168-171: The find method on line 170 uses substring matching with
includes(sandboxName), which can cause false positives when multiple sandboxes
have similarly named identifiers. Replace the includes check with a word
boundary regex match to ensure the sandboxName is matched as a complete bounded
token rather than a substring, preventing similarly named sandboxes from
incorrectly satisfying the readiness check.
🪄 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: cd7961a0-8bdf-4663-81c5-2234cade00d7
📒 Files selected for processing (8)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/live/channels-stop-start-helpers.tstest/e2e-scenario/live/channels-stop-start-safety.tstest/e2e-scenario/live/channels-stop-start.test.tstest/e2e-scenario/live/phase6-messaging-helpers.tstest/e2e-scenario/live/telegram-injection.test.tstest/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tstools/e2e-scenarios/workflow-boundary.mts
| const row = stripAnsi(list.stdout) | ||
| .split(/\r?\n/) | ||
| .find((line) => line.includes(sandboxName)); | ||
| expect(row, resultText(list)).toMatch(/\bReady\b/i); |
There was a problem hiding this comment.
Match sandbox rows exactly when asserting readiness.
Line 170 uses substring matching (includes), so similarly named sandboxes can satisfy the check and mask readiness failures in downstream live scenarios. Match sandbox name as a bounded token instead.
Proposed fix
export async function expectSandboxReady(
host: HostCliClient,
sandboxName: string,
env: NodeJS.ProcessEnv,
redactions: string[],
artifactName: string,
): Promise<void> {
const list = await host.command("openshell", ["sandbox", "list"], {
artifactName,
env,
redactionValues: redactions,
timeoutMs: 60_000,
});
expectExitZero(list, "openshell sandbox list");
+ const escapedSandboxName = sandboxName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const row = stripAnsi(list.stdout)
.split(/\r?\n/)
- .find((line) => line.includes(sandboxName));
+ .find((line) => new RegExp(`(?:^|\\s)${escapedSandboxName}(?:\\s|$)`).test(line));
expect(row, resultText(list)).toMatch(/\bReady\b/i);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const row = stripAnsi(list.stdout) | |
| .split(/\r?\n/) | |
| .find((line) => line.includes(sandboxName)); | |
| expect(row, resultText(list)).toMatch(/\bReady\b/i); | |
| const escapedSandboxName = sandboxName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | |
| const row = stripAnsi(list.stdout) | |
| .split(/\r?\n/) | |
| .find((line) => new RegExp(`(?:^|\\s)${escapedSandboxName}(?:\\s|$)`).test(line)); | |
| expect(row, resultText(list)).toMatch(/\bReady\b/i); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/e2e-scenario/live/phase6-messaging-helpers.ts` around lines 168 - 171,
The find method on line 170 uses substring matching with includes(sandboxName),
which can cause false positives when multiple sandboxes have similarly named
identifiers. Replace the includes check with a word boundary regex match to
ensure the sandboxName is matched as a complete bounded token rather than a
substring, preventing similarly named sandboxes from incorrectly satisfying the
readiness check.
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27968060310
|
|
PRA test follow-up evidence for current head
Result: 2 passed, 0 failed, 54 skipped for requested job |
Summary
Migrates the channels stop/start E2E lifecycle into the live Vitest system. The replacement keeps the OpenClaw and Hermes real install, channels CLI, rebuild, registry, provider, policy-list, and in-sandbox configuration boundaries.
Related Issue
Refs #5098
Changes
test/e2e-scenario/live/channels-stop-start.test.tsas Vitest coverage fortest/e2e/test-channels-stop-start.sh.test/e2e-scenario/live/channels-stop-start-helpers.tsto keep the test entrypoint linear while preserving channel lifecycle assertion logic.channels-stop-start-vitestjob into.github/workflows/e2e-vitest-scenarios.yamlfor OpenClaw and Hermes.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Release Notes
Tests
CI/CD
Chores