Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/e2e-vitest-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,76 @@ jobs:
if-no-files-found: ignore
retention-days: 14


onboard-resume-vitest:
needs: generate-matrix
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',onboard-resume-vitest,') || contains(format(',{0},', inputs.scenarios), ',onboard-resume,') }}
runs-on: ubuntu-latest
timeout-minutes: 45
env:
FREE_STANDING_VITEST_JOB: "1"
FREE_STANDING_SCENARIO_ID: "onboard-resume"
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/vitest/onboard-resume
NEMOCLAW_CLI_BIN: ${{ github.workspace }}/bin/nemoclaw.js
NEMOCLAW_RUN_E2E_SCENARIOS: "1"
NEMOCLAW_NON_INTERACTIVE: "1"
NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1"
NEMOCLAW_SANDBOX_NAME: "e2e-resume"
NEMOCLAW_PROVIDER: "custom"
NEMOCLAW_ENDPOINT_URL: "https://inference-api.nvidia.com/v1"
NEMOCLAW_MODEL: "nvidia/nvidia/nemotron-3-super-v3"
NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-super-v3"
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
with:
node-version: 22
cache: npm

- name: Install root dependencies
run: npm ci --ignore-scripts

- name: Build CLI
run: npm run build:cli

- name: Install OpenShell CLI
run: bash scripts/install-openshell.sh

- name: Run onboard-resume live Vitest test
env:
NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }}
COMPATIBLE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }}
run: |
Comment thread
coderabbitai[bot] marked this conversation as resolved.
set -euo pipefail
export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH"
if command -v openshell >/dev/null 2>&1; then
OPENSHELL_BIN="$(command -v openshell)"
elif [ -x "$HOME/.local/bin/openshell" ]; then
OPENSHELL_BIN="$HOME/.local/bin/openshell"
else
echo "::error::OpenShell CLI not found after install"
exit 1
fi
export OPENSHELL_BIN
"$OPENSHELL_BIN" --version
npx vitest run --project e2e-scenarios-live \
test/e2e-scenario/live/onboard-resume.test.ts \
--silent=false --reporter=default

- name: Upload onboard-resume artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-vitest-scenarios-onboard-resume
path: e2e-artifacts/vitest/onboard-resume/
include-hidden-files: false
if-no-files-found: ignore
retention-days: 14

token-rotation-vitest:
needs: generate-matrix
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',token-rotation-vitest,') || contains(format(',{0},', inputs.scenarios), ',token-rotation,') }}
Expand Down Expand Up @@ -2986,6 +3056,7 @@ jobs:
messaging-providers-vitest,
launchable-smoke-vitest,
double-onboard-vitest,
onboard-resume-vitest,
model-router-provider-routed-inference-vitest,
sandbox-survival-vitest,
gateway-drift-preflight-vitest,
Expand Down
30 changes: 16 additions & 14 deletions test/e2e-scenario/live/onboard-resume.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import path from "node:path";
import { buildAvailabilityProbeEnv } from "../fixtures/availability-env.ts";
import { validateSandboxName } from "../fixtures/clients/sandbox.ts";
import { expect, test } from "../fixtures/e2e-test.ts";
import { requireHostedInferenceConfig } from "../fixtures/hosted-inference.ts";
import { shouldRunLiveE2EScenarios } from "../fixtures/live-project-gate.ts";

// Adds focused Vitest live coverage for test/e2e/test-onboard-resume.sh's
Expand Down Expand Up @@ -45,7 +46,7 @@ interface SessionStateInterrupted {

interface SessionStateComplete {
status: "complete";
provider: "nvidia-prod";
provider: string;
steps: Record<
| "preflight"
| "gateway"
Expand Down Expand Up @@ -131,13 +132,11 @@ test.skipIf(!shouldRunLiveE2EScenarios())(
});
expect(openshellVersion.exitCode, openshellVersion.stderr).toBe(0);

// Assertion: nvidia-api-key-present — secrets.required(...) skips the test
// if NVIDIA_INFERENCE_API_KEY is unset (correct behavior under workflow_dispatch
// without the secret wired in).
const apiKey = secrets.required("NVIDIA_INFERENCE_API_KEY");
expect(apiKey.startsWith("nvapi-"), "NVIDIA_INFERENCE_API_KEY must start with nvapi-").toBe(
true,
);
// Assertion: hosted-inference-secret-present — the workflow passes the
// scoped NVIDIA_INFERENCE_API_KEY secret through the compatible-endpoint
// contract, matching the legacy hosted-compatible E2E helper.
const hosted = requireHostedInferenceConfig(secrets);
const apiKey = hosted.apiKey;

// ──────────────────────────────────────────────────────────────────
// Phase 0 (deferred): pre-cleanup of leftover sandbox/session state.
Expand Down Expand Up @@ -213,6 +212,7 @@ test.skipIf(!shouldRunLiveE2EScenarios())(
env: {
...buildAvailabilityProbeEnv(),
NVIDIA_INFERENCE_API_KEY: apiKey,
...hosted.env,
NEMOCLAW_SANDBOX_NAME: SANDBOX_NAME,
NEMOCLAW_RECREATE_SANDBOX: "1",
NEMOCLAW_POLICY_MODE: "suggested",
Expand Down Expand Up @@ -291,10 +291,12 @@ test.skipIf(!shouldRunLiveE2EScenarios())(
expect(resumeText).toContain("[resume] Skipping gateway (running)");
expect(resumeText).toContain(`[resume] Skipping sandbox (${SANDBOX_NAME})`);

// Assertion: resume-no-{preflight,gateway,sandbox}-rerun.
expect(resumeText).not.toContain("[1/8] Preflight checks");
expect(resumeText).not.toContain("[2/8] Starting OpenShell gateway");
expect(resumeText).not.toContain("[6/8] Creating sandbox");
// Assertion: resume-no-{preflight,gateway,sandbox}-redo. Current CLI output
// still prints phase headings before the resume-skip decisions, so assert
// the skip evidence and absence of redo-only success strings instead of
// rejecting headings that now frame the skipped phases.
expect(resumeText).not.toContain("Sandbox '" + SANDBOX_NAME + "' created");
expect(resumeText).not.toContain("Starting OpenShell Docker-driver gateway...");

// Assertion: resume-inference-handled — first onboard completed through
// openclaw before failing at policies. Inference was already configured
Expand All @@ -318,7 +320,7 @@ test.skipIf(!shouldRunLiveE2EScenarios())(
const complete = readSession<SessionStateComplete>(SESSION_FILE);
await artifacts.writeJson("phase-3-session-summary.json", completeSessionSummary(complete));
expect(complete.status).toBe("complete");
expect(complete.provider).toBe("nvidia-prod");
expect(complete.provider).toBe(hosted.providerName);
for (const step of [
"preflight",
"gateway",
Expand All @@ -329,7 +331,7 @@ test.skipIf(!shouldRunLiveE2EScenarios())(
"policies",
"agent_setup",
] as const) {
expect(complete.steps[step]?.status, `step ${step}`).toBe("complete");
expect(["complete", "skipped"]).toContain(complete.steps[step]?.status);
}

// Assertion: registry-has-sandbox.
Expand Down