惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
P
Proofpoint News Feed
The Cloudflare Blog
D
Docker
大猫的无限游戏
大猫的无限游戏

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten update cli spawn assertions · openclaw/open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -359,12 +359,44 @@ describe("update-cli", () => {

359359

return call;

360360

};

361361362+

const commandCall = (index = 0) => {

363+

const calls = vi.mocked(runCommandWithTimeout).mock.calls as unknown as Array<

364+

[string[], Record<string, unknown>]

365+

>;

366+

return calls[index];

367+

};

368+369+

const spawnCall = (index = 0) => {

370+

const calls = spawn.mock.calls as unknown as Array<

371+

[string, string[], { env?: NodeJS.ProcessEnv; stdio?: unknown }]

372+

>;

373+

return calls[index];

374+

};

375+376+

const spawnSyncCall = (index = 0) => {

377+

const calls = vi.mocked(spawnSync).mock.calls as unknown as Array<

378+

[string, string[], { env?: NodeJS.ProcessEnv; timeout?: number }]

379+

>;

380+

return calls[index];

381+

};

382+362383

const expectPackageInstallSpec = (spec: string) => {

363384

expect(runGatewayUpdate).not.toHaveBeenCalled();

364-

expect(runCommandWithTimeout).toHaveBeenCalledWith(

365-

["npm", "i", "-g", spec, "--no-fund", "--no-audit", "--loglevel=error"],

366-

expect.any(Object),

367-

);

385+

const call = (

386+

vi.mocked(runCommandWithTimeout).mock.calls as unknown as Array<

387+

[string[], Record<string, unknown>]

388+

>

389+

).find(([argv]) => argv[0] === "npm" && argv[1] === "i" && argv[2] === "-g");

390+

expect(call?.[0]).toEqual([

391+

"npm",

392+

"i",

393+

"-g",

394+

spec,

395+

"--no-fund",

396+

"--no-audit",

397+

"--loglevel=error",

398+

]);

399+

expect(call?.[1]).toBeDefined();

368400

};

369401370402

const statfsFixture = (params: {

@@ -616,16 +648,11 @@ describe("update-cli", () => {

616648617649

await updateCliShared.tryWriteCompletionCache(root, false);

618650619-

expect(spawnSync).toHaveBeenCalledWith(

620-

expect.any(String),

621-

[path.join(root, "openclaw.mjs"), "completion", "--write-state"],

622-

expect.objectContaining({

623-

env: expect.objectContaining({

624-

OPENCLAW_COMPLETION_SKIP_PLUGIN_COMMANDS: "1",

625-

}),

626-

timeout: 30_000,

627-

}),

628-

);

651+

const call = spawnSyncCall();

652+

expect(typeof call?.[0]).toBe("string");

653+

expect(call?.[1]).toEqual([path.join(root, "openclaw.mjs"), "completion", "--write-state"]);

654+

expect(call?.[2]?.env?.OPENCLAW_COMPLETION_SKIP_PLUGIN_COMMANDS).toBe("1");

655+

expect(call?.[2]?.timeout).toBe(30_000);

629656

});

630657631658

it("refuses mutating updates in Nix mode before update side effects", async () => {

@@ -658,30 +685,23 @@ describe("update-cli", () => {

658685

await updateCliShared.tryWriteCompletionCache(root, false);

659686660687

const logs = vi.mocked(runtimeCapture.log).mock.calls.map((call) => String(call[0]));

661-

expect(logs).toEqual(expect.arrayContaining([expect.stringContaining("timed out after 30s")]));

662-

expect(logs).toEqual(

663-

expect.arrayContaining([expect.stringContaining("openclaw completion --write-state")]),

664-

);

665-

expect(logs).not.toEqual(expect.arrayContaining([expect.stringContaining("Error: spawnSync")]));

688+

expect(logs.some((line) => line.includes("timed out after 30s"))).toBe(true);

689+

expect(logs.some((line) => line.includes("openclaw completion --write-state"))).toBe(true);

690+

expect(logs.some((line) => line.includes("Error: spawnSync"))).toBe(false);

666691

});

667692668693

it("respawns into the updated package root before running post-update tasks", async () => {

669694

const { entrypoints } = setupUpdatedRootRefresh();

670695671696

await updateCommand({ yes: true, timeout: "1800" });

672697673-

expect(spawn).toHaveBeenCalledWith(

674-

expect.stringMatching(/node/),

675-

[entrypoints[0], "update", "--yes", "--timeout", "1800"],

676-

expect.objectContaining({

677-

stdio: "inherit",

678-

env: expect.objectContaining({

679-

NODE_DISABLE_COMPILE_CACHE: "1",

680-

OPENCLAW_UPDATE_POST_CORE: "1",

681-

OPENCLAW_UPDATE_POST_CORE_CHANNEL: "dev",

682-

}),

683-

}),

684-

);

698+

const call = spawnCall();

699+

expect(call?.[0]).toMatch(/node/);

700+

expect(call?.[1]).toEqual([entrypoints[0], "update", "--yes", "--timeout", "1800"]);

701+

expect(call?.[2]?.stdio).toBe("inherit");

702+

expect(call?.[2]?.env?.NODE_DISABLE_COMPILE_CACHE).toBe("1");

703+

expect(call?.[2]?.env?.OPENCLAW_UPDATE_POST_CORE).toBe("1");

704+

expect(call?.[2]?.env?.OPENCLAW_UPDATE_POST_CORE_CHANNEL).toBe("dev");

685705

expect(updateNpmInstalledPlugins).not.toHaveBeenCalled();

686706

expect(runDaemonInstall).not.toHaveBeenCalled();

687707

expect(runDaemonRestart).not.toHaveBeenCalled();