Files
openclaw/test/scripts/docker-e2e-crestodian.test.ts
Peter Steinberger 96f0983a85 fix(onboarding): skip setup for configured gateways and require inference first (#102883)
* fix(crestodian): keep onboarding RPCs restart-safe

* fix(profiles): isolate approval state migrations

* fix(crestodian): bypass configured gateway setup

* test(crestodian): type onboarding mocks

* fix(onboarding): require inference before Crestodian

* fix(onboarding): enforce verified inference handoff

* fix(macos): reset setup on gateway endpoint edits

* chore(i18n): refresh native source inventory

* fix(gateway): keep socket on request cancellation

* test(packaging): require workspace templates

* fix(onboarding): bind setup to verified inference

* fix(onboarding): align inference gate contracts

* fix(crestodian): classify concurrent policy rejection

* test(crestodian): expect registry restoration

* fix(onboarding): bind setup to configured gateways

* fix(codex): preserve startup phase deadlines

* test(crestodian): match fail-closed policy ordering

* test(onboarding): assert bound gateway handoff

* fix(codex): bind runtime resolution to spawn cwd

* test(crestodian): assert policy rejection order

* fix(cli): preserve gateway routing across restarts

* fix(macos): fail closed during gateway edits

* test(macos): cover gateway route generation races

* chore: keep release notes out of onboarding PR

* fix(ci): refresh onboarding generated checks

* style(swift): align gateway channel formatting

* fix(ci): refresh plugin SDK surface budgets

* fix(ci): resync native string inventory

* refactor(swift): split gateway channel support

* test(doctor): isolate plugin compatibility registry

* test(macos): isolate gateway onboarding fixtures

* test(macos): assert gateway lease health ordering

* fix(codex): reconcile computer-use startup changes
2026-07-11 10:25:14 -07:00

59 lines
3.2 KiB
TypeScript

// Crestodian Docker E2E tests cover packaged-dist harness wiring.
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
function readScript(pathname: string): string {
return readFileSync(pathname, "utf8");
}
describe("Crestodian Docker E2E scripts", () => {
it("keeps first-run checks wired to packaged CLI and Crestodian behavior", () => {
const source = readScript("test/e2e/qa-lab/runtime/crestodian-first-run-docker-client.ts");
const spec = readScript("scripts/e2e/crestodian-first-run-spec.json");
expect(source).toContain("../../../../dist/cli/run-main.js");
expect(source).toContain("../../../../dist/crestodian/setup-inference.js");
expect(source).toContain("shouldStartOnboardingForFreshInstall");
expect(source).toContain("Crestodian did not fail closed without inference");
expect(source).toContain("activateSetupInference({");
expect(source).toContain('runPackagedCli(["crestodian", "--message", "overview"])');
expect(source).toContain("const PACKAGED_CLI_TIMEOUT_MS = 60_000");
expect(source).toContain("inference activation did not send the live model probe");
expect(source).toContain("function resolveDefaultModel(config: OpenClawConfig)");
expect(source).toContain("resolveDefaultModel(config) === spec.model");
expect(source).toContain("Fake Claude planner selected an inference-backed typed setup.");
expect(source).toContain("[crestodian] interpreted: ${plannerCommand}");
expect(source).toContain("expected one fuzzy setup planner prompt");
expect(source).toContain('runPackagedCli(["plugins", "list", "--json"])');
expect(source).toContain(
"Telegram channel config did not auto-enable the packaged Telegram plugin",
);
expect(source).toContain("Crestodian first-run Docker E2E passed");
expect(spec).toContain('"auditOperations"');
expect(spec).toContain('"crestodian.setup"');
expect(spec).toContain('"model": "claude-cli/claude-opus-4-8"');
expect(spec).toContain('"planner": true');
expect(spec).toContain('"telegramEnv": "TELEGRAM_BOT_TOKEN"');
expect(spec).toContain("config set-ref channels.telegram.botToken env {telegramEnv}");
expect(spec).not.toContain("plugins.allow");
expect(spec).not.toContain("plugins.entries.telegram.enabled");
expect(spec).not.toContain("channels.discord");
});
it("keeps rescue checks wired through auto-reply command handling", () => {
const shell = readScript("scripts/e2e/crestodian-rescue-docker.sh");
const source = readScript("scripts/e2e/crestodian-rescue-docker-client.ts");
expect(shell).toContain("OPENCLAW_GATEWAY_TOKEN=crestodian-rescue-token");
expect(source).toContain("../../dist/auto-reply/reply/commands-crestodian.js");
expect(source).toContain("../../dist/crestodian/rescue-message.js");
expect(source).toContain("handleCrestodianCommand(");
expect(source).toContain("runCrestodianRescueMessage({");
expect(source).toContain("sandboxing is active");
expect(source).toContain("cannot open the local TUI");
expect(source).toContain("[crestodian] done: gateway.restart");
expect(source).toContain("[crestodian] done: doctor.fix");
expect(source).toContain("Crestodian rescue Docker E2E passed");
});
});