mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 17:50:47 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
44
openclaw/test/cli-json-stdout.e2e.test.ts
Normal file
44
openclaw/test/cli-json-stdout.e2e.test.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { withTempHome } from "./helpers/temp-home.ts";
|
||||
|
||||
describe("cli json stdout contract", () => {
|
||||
it("keeps `update status --json` stdout parseable even with legacy doctor preflight inputs", async () => {
|
||||
await withTempHome(
|
||||
async (tempHome) => {
|
||||
const legacyDir = path.join(tempHome, ".clawdbot");
|
||||
await fs.mkdir(legacyDir, { recursive: true });
|
||||
await fs.writeFile(path.join(legacyDir, "clawdbot.json"), "{}", "utf8");
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
HOME: tempHome,
|
||||
USERPROFILE: tempHome,
|
||||
OPENCLAW_TEST_FAST: "1",
|
||||
};
|
||||
delete env.OPENCLAW_HOME;
|
||||
delete env.OPENCLAW_STATE_DIR;
|
||||
delete env.OPENCLAW_CONFIG_PATH;
|
||||
delete env.VITEST;
|
||||
|
||||
const entry = path.resolve(process.cwd(), "openclaw.mjs");
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[entry, "update", "status", "--json", "--timeout", "1"],
|
||||
{ cwd: process.cwd(), env, encoding: "utf8" },
|
||||
);
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
const stdout = result.stdout.trim();
|
||||
expect(stdout.length).toBeGreaterThan(0);
|
||||
expect(() => JSON.parse(stdout)).not.toThrow();
|
||||
expect(stdout).not.toContain("Doctor warnings");
|
||||
expect(stdout).not.toContain("Doctor changes");
|
||||
expect(stdout).not.toContain("Config invalid");
|
||||
},
|
||||
{ prefix: "openclaw-json-e2e-" },
|
||||
);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue