test(e2e): add onboarding phase fixture#5003
Conversation
|
Warning Review limit reached
More reviews will be available in 40 minutes and 8 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an OnboardingPhaseFixture with cloud and no-Docker flows, wires an ChangesEnd-to-end Onboarding Phase Fixture and Framework Integration
Sequence Diagram(s)sequenceDiagram
participant VitestTest
participant OnboardingPhaseFixture
participant OnboardingSecrets
participant HostCliClient
participant OnboardingCleanup
VitestTest->>OnboardingPhaseFixture: from(environment, options)
OnboardingPhaseFixture->>OnboardingSecrets: required("NVIDIA_API_KEY")
OnboardingPhaseFixture->>HostCliClient: nemoclaw("onboard", args, { env, timeout })
OnboardingPhaseFixture->>OnboardingCleanup: add(sandboxName, destroyFn)
HostCliClient-->>OnboardingPhaseFixture: ShellProbeResult (stdout/stderr)
OnboardingPhaseFixture-->>VitestTest: NemoClawInstance (or expectedFailure)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/e2e-scenario/framework-tests/e2e-phase-onboarding.test.ts (1)
42-45: ⚡ Quick winFail fast when no queued runner response exists.
Returning a default success (
shellResult(0)) can hide missing test setup and produce false positives. Throwing here makes tests deterministic and stricter.Proposed change
async run(command: TrustedShellCommand, options?: ShellProbeRunOptions): Promise<ShellProbeResult> { this.calls.push({ command: command.command, args: [...command.args], options }); - return this.responses.shift() ?? shellResult(0); + const next = this.responses.shift(); + if (!next) { + throw new Error(`FakeRunner received unexpected command without queued response: ${command.command}`); + } + return next; }🤖 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/framework-tests/e2e-phase-onboarding.test.ts` around lines 42 - 45, The test runner's async run method currently returns a default success when no queued response exists, which hides missing test setup; modify run (the method that pushes to this.calls and uses this.responses.shift()) to throw an informative error when this.responses is empty/undefined instead of returning shellResult(0), so callers fail fast and tests remain deterministic. Ensure the thrown error message includes the command and args (from command.command and command.args) to aid debugging.
🤖 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/framework/phases/onboarding.ts`:
- Line 134: Replace the unconditional prepend of shimDir that can create a
trailing colon by only adding the colon when PATH exists: set env.PATH to either
"shimDir:existingPATH" when env.PATH is truthy or to just "shimDir" when
env.PATH is undefined/empty; update the assignment that uses env.PATH and
shimDir in onboarding.ts (the env.PATH = `${shimDir}:${env.PATH ?? ""}` line) to
use this conditional form so you don't introduce an empty PATH segment.
---
Nitpick comments:
In `@test/e2e-scenario/framework-tests/e2e-phase-onboarding.test.ts`:
- Around line 42-45: The test runner's async run method currently returns a
default success when no queued response exists, which hides missing test setup;
modify run (the method that pushes to this.calls and uses
this.responses.shift()) to throw an informative error when this.responses is
empty/undefined instead of returning shellResult(0), so callers fail fast and
tests remain deterministic. Ensure the thrown error message includes the command
and args (from command.command and command.args) to aid debugging.
🪄 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: b320c7ef-7fb5-4442-9385-bed837caa3a3
📒 Files selected for processing (4)
test/e2e-scenario/framework-tests/e2e-phase-onboarding.test.tstest/e2e-scenario/framework/e2e-test.tstest/e2e-scenario/framework/phases/index.tstest/e2e-scenario/framework/phases/onboarding.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e-scenario/scenarios/assertions/registry.ts (1)
283-283: ⚡ Quick winUse a dedicated snapshot step ID instead of reusing
smokeSteps[2].Right now
snapshotshares the same step ID/evidence path assmoke(runtime.smoke.sandbox-listed), which can make evidence attribution ambiguous when both suites are selected.Suggested diff
- suiteGroup("snapshot", [smokeSteps[2]]), + suiteGroup("snapshot", [ + shellStep({ + id: "runtime.snapshot.sandbox-listed", + phase: "runtime", + ref: "test/e2e-scenario/validation_suites/smoke/02-sandbox-listed.sh", + }), + ]),🤖 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/scenarios/assertions/registry.ts` at line 283, Replace the reused step id by creating and using a dedicated snapshot step instead of smokeSteps[2]; update the suiteGroup call for "snapshot" to reference a new snapshotSteps entry (e.g., snapshotSteps[0]) and ensure the new step's id/evidence path is unique (not runtime.smoke.sandbox-listed) so evidence is attributed to runtime.snapshot.*; locate the definition of smokeSteps and add a corresponding snapshotSteps array (or an individual snapshot step) with its own id and evidence path, then change suiteGroup("snapshot", [smokeSteps[2]]) to use that new snapshot step symbol.
🤖 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.
Nitpick comments:
In `@test/e2e-scenario/scenarios/assertions/registry.ts`:
- Line 283: Replace the reused step id by creating and using a dedicated
snapshot step instead of smokeSteps[2]; update the suiteGroup call for
"snapshot" to reference a new snapshotSteps entry (e.g., snapshotSteps[0]) and
ensure the new step's id/evidence path is unique (not
runtime.smoke.sandbox-listed) so evidence is attributed to runtime.snapshot.*;
locate the definition of smokeSteps and add a corresponding snapshotSteps array
(or an individual snapshot step) with its own id and evidence path, then change
suiteGroup("snapshot", [smokeSteps[2]]) to use that new snapshot step symbol.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9a7cd64a-d6b6-4d70-bb9b-bac8e99978c7
📒 Files selected for processing (11)
test/e2e-scenario/framework-tests/e2e-assertion-modules.test.tstest/e2e-scenario/framework-tests/e2e-lib-helpers.test.tstest/e2e-scenario/framework-tests/e2e-phase-environment.test.tstest/e2e-scenario/framework-tests/e2e-phase-onboarding.test.tstest/e2e-scenario/framework/clients/index.tstest/e2e-scenario/framework/clients/sandbox.tstest/e2e-scenario/framework/e2e-test.tstest/e2e-scenario/framework/phases/environment.tstest/e2e-scenario/framework/phases/onboarding.tstest/e2e-scenario/nemoclaw_scenarios/onboard/cloud-openclaw-no-docker.shtest/e2e-scenario/scenarios/assertions/registry.ts
✅ Files skipped from review due to trivial changes (1)
- test/e2e-scenario/framework/clients/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- test/e2e-scenario/framework/e2e-test.ts
- test/e2e-scenario/framework-tests/e2e-phase-onboarding.test.ts
- test/e2e-scenario/framework/phases/onboarding.ts
Summary
Adds the typed onboarding phase fixture on top of the environment phase. This starts moving live scenario setup into Vitest fixtures by wiring cloud OpenClaw onboarding and the no-Docker preflight-negative fixture path while preserving the legacy shell-dispatched no-Docker worker until that phase is fully migrated.
Related Issue
Refs #4941
Refs #4990
Changes
OnboardingPhaseFixturewithfrom(...),cloudOpenClaw(...), andcloudOpenClawNoDocker(...)paths.cloud-openclaw-no-dockershell worker as the current dispatcher target during migration, but aligns its Docker-missing signature and redactednegative-preflight.logevidence contract with the typed fixture.onboardon the shared Vitest E2E scenario context.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Latest focused verification:
npx vitest run --project e2e-scenario-frameworkSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit