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

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
腾讯CDC
G
Google Developers Blog
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
有赞技术团队
有赞技术团队
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
美团技术团队
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志

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: dedupe postinstall missing path assertions · opencl...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -30,6 +30,10 @@ async function expectPathExists(filePath: string) {

3030

await expect(fs.access(filePath)).resolves.toBeUndefined();

3131

}

323233+

async function expectPathMissing(filePath: string) {

34+

await expect(fs.access(filePath)).rejects.toHaveProperty("code", "ENOENT");

35+

}

36+3337

async function writePluginPackage(

3438

extensionsDir: string,

3539

pluginId: string,

@@ -242,9 +246,7 @@ describe("bundled plugin postinstall", () => {

242246

log: { log: vi.fn(), warn: vi.fn() },

243247

});

244248245-

await expect(fs.stat(path.join(extensionsDir, "acpx", "node_modules"))).rejects.toMatchObject({

246-

code: "ENOENT",

247-

});

249+

await expectPathMissing(path.join(extensionsDir, "acpx", "node_modules"));

248250

});

249251250252

it("keeps source-checkout prune non-fatal", async () => {

@@ -453,7 +455,7 @@ describe("bundled plugin postinstall", () => {

453455

).toEqual(["dist/channel-CJUAgRQR.js"]);

454456455457

await expectPathExists(currentFile);

456-

await expect(fs.stat(staleFile)).rejects.toMatchObject({ code: "ENOENT" });

458+

await expectPathMissing(staleFile);

457459

});

458460459461

it("prunes legacy plugin runtime deps state during packaged postinstall", async () => {

@@ -514,11 +516,11 @@ describe("bundled plugin postinstall", () => {

514516

log,

515517

});

516518517-

await expect(fs.stat(defaultLegacyRoot)).rejects.toMatchObject({ code: "ENOENT" });

518-

await expect(fs.stat(oldBrandLegacyRoot)).rejects.toMatchObject({ code: "ENOENT" });

519-

await expect(fs.stat(overrideLegacyRoot)).rejects.toMatchObject({ code: "ENOENT" });

520-

await expect(fs.stat(systemLegacyRoot)).rejects.toMatchObject({ code: "ENOENT" });

521-

await expect(fs.lstat(legacySymlink)).rejects.toMatchObject({ code: "ENOENT" });

519+

await expectPathMissing(defaultLegacyRoot);

520+

await expectPathMissing(oldBrandLegacyRoot);

521+

await expectPathMissing(overrideLegacyRoot);

522+

await expectPathMissing(systemLegacyRoot);

523+

await expectPathMissing(legacySymlink);

522524

await expectPathExists(thirdPartyNodeModules);

523525

expect(log.warn).not.toHaveBeenCalled();

524526

expect(log.log).toHaveBeenCalledWith(

@@ -555,8 +557,8 @@ describe("bundled plugin postinstall", () => {

555557

log,

556558

});

557559558-

await expect(fs.lstat(slackLink)).rejects.toMatchObject({ code: "ENOENT" });

559-

await expect(fs.stat(legacyRuntimeRoot)).rejects.toMatchObject({ code: "ENOENT" });

560+

await expectPathMissing(slackLink);

561+

await expectPathMissing(legacyRuntimeRoot);

560562

expect(log.warn).not.toHaveBeenCalled();

561563

expect(log.log).toHaveBeenCalledWith(

562564

expect.stringContaining("[postinstall] pruned legacy plugin runtime deps symlinks:"),

@@ -625,7 +627,7 @@ describe("bundled plugin postinstall", () => {

625627

).toEqual(["dist/memory-state-old.js"]);

626628627629

await expectPathExists(importedChunk);

628-

await expect(fs.stat(staleFile)).rejects.toMatchObject({ code: "ENOENT" });

630+

await expectPathMissing(staleFile);

629631

});

630632631633

it("does not abort dist pruning when a listed chunk disappears before import expansion", async () => {

@@ -653,7 +655,7 @@ describe("bundled plugin postinstall", () => {

653655

}),

654656

).toEqual(["dist/stale.js"]);

655657656-

await expect(fs.stat(staleFile)).rejects.toMatchObject({ code: "ENOENT" });

658+

await expectPathMissing(staleFile);

657659

});

658660659661

it("prunes stale private QA files without restoring compat sidecars", async () => {

@@ -678,20 +680,20 @@ describe("bundled plugin postinstall", () => {

678680

log: { log: vi.fn(), warn: vi.fn() },

679681

});

680682681-

await expect(fs.stat(stalePackage)).rejects.toMatchObject({ code: "ENOENT" });

682-

await expect(fs.stat(staleManifest)).rejects.toMatchObject({ code: "ENOENT" });

683-

await expect(

684-

fs.stat(path.join(packageRoot, "dist", "extensions", "qa-channel", "runtime-api.js")),

685-

).rejects.toMatchObject({ code: "ENOENT" });

686-

await expect(

687-

fs.stat(path.join(packageRoot, "dist", "extensions", "qa-channel", "package.json")),

688-

).rejects.toMatchObject({ code: "ENOENT" });

689-

await expect(

690-

fs.stat(path.join(packageRoot, "dist", "extensions", "qa-channel", "openclaw.plugin.json")),

691-

).rejects.toMatchObject({ code: "ENOENT" });

692-

await expect(

693-

fs.stat(path.join(packageRoot, "dist", "extensions", "qa-lab", "runtime-api.js")),

694-

).rejects.toMatchObject({ code: "ENOENT" });

683+

await expectPathMissing(stalePackage);

684+

await expectPathMissing(staleManifest);

685+

await expectPathMissing(

686+

path.join(packageRoot, "dist", "extensions", "qa-channel", "runtime-api.js"),

687+

);

688+

await expectPathMissing(

689+

path.join(packageRoot, "dist", "extensions", "qa-channel", "package.json"),

690+

);

691+

await expectPathMissing(

692+

path.join(packageRoot, "dist", "extensions", "qa-channel", "openclaw.plugin.json"),

693+

);

694+

await expectPathMissing(

695+

path.join(packageRoot, "dist", "extensions", "qa-lab", "runtime-api.js"),

696+

);

695697

});

696698697699

it("keeps packaged postinstall non-fatal when the dist inventory is missing", async () => {

@@ -842,15 +844,9 @@ describe("bundled plugin postinstall", () => {

842844

log: { log: vi.fn(), warn: vi.fn() },

843845

}),

844846

).toEqual(["dist/stale-runtime.js"]);

845-

await expect(

846-

fs.stat(path.join(packageRoot, "dist", "extensions", "slack", "node_modules")),

847-

).rejects.toMatchObject({ code: "ENOENT" });

848-

await expect(fs.stat(path.dirname(installStageFile))).rejects.toMatchObject({

849-

code: "ENOENT",

850-

});

851-

await expect(fs.stat(path.dirname(retryInstallStageFile))).rejects.toMatchObject({

852-

code: "ENOENT",

853-

});

847+

await expectPathMissing(path.join(packageRoot, "dist", "extensions", "slack", "node_modules"));

848+

await expectPathMissing(path.dirname(installStageFile));

849+

await expectPathMissing(path.dirname(retryInstallStageFile));

854850

});

855851856852

it("unlinks stale files instead of recursive pruning them", () => {

@@ -899,9 +895,7 @@ describe("bundled plugin postinstall", () => {

899895900896

pruneBundledPluginSourceNodeModules({ extensionsDir });

901897902-

await expect(fs.stat(path.join(extensionsDir, "acpx", "node_modules"))).rejects.toMatchObject({

903-

code: "ENOENT",

904-

});

898+

await expectPathMissing(path.join(extensionsDir, "acpx", "node_modules"));

905899

await expectPathExists(path.join(extensionsDir, "fixtures", "node_modules"));

906900

});

907901