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

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

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
fix(test): prefer local bundled plugins in linked Vitest ...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -14,6 +14,7 @@ import {

1414

resolveDirectNodeVitestArgs,

1515

resolveExplicitTestFileNoPassArgs,

1616

resolveImplicitVitestArgs,

17+

resolveLinkedSourceBundledPluginsEnv,

1718

resolveMissingVitestDependencyMessage,

1819

resolveMissingExplicitTestFiles,

1920

resolveRunVitestSpawnEnv,

@@ -30,6 +31,34 @@ import {

30313132

const posixIt = process.platform === "win32" ? it.skip : it;

323334+

function createRunVitestFs(params: { nodeModulesSymlink: boolean; bundledPlugin: boolean }) {

35+

return {

36+

existsSync: (filePath: string) => {

37+

const normalized = filePath.replaceAll("\\", "/");

38+

return (

39+

normalized === "/repo/extensions" ||

40+

(params.bundledPlugin &&

41+

(normalized === "/repo/extensions/codex/package.json" ||

42+

normalized === "/repo/extensions/codex/openclaw.plugin.json"))

43+

);

44+

},

45+

lstatSync: (filePath: string) => {

46+

if (filePath.replaceAll("\\", "/") !== "/repo/node_modules") {

47+

throw new Error(`unexpected lstat path: ${filePath}`);

48+

}

49+

return {

50+

isSymbolicLink: () => params.nodeModulesSymlink,

51+

};

52+

},

53+

readdirSync: (filePath: string) => {

54+

if (filePath.replaceAll("\\", "/") !== "/repo/extensions") {

55+

throw new Error(`unexpected readdir path: ${filePath}`);

56+

}

57+

return params.bundledPlugin ? [{ name: "codex", isDirectory: () => true }] : [];

58+

},

59+

};

60+

}

61+3362

describe("scripts/run-vitest", () => {

3463

it("adds --no-maglev to vitest child processes by default", () => {

3564

expect(resolveVitestNodeArgs({ PATH: "/usr/bin" })).toEqual(["--no-maglev"]);

@@ -573,6 +602,45 @@ describe("scripts/run-vitest", () => {

573602

});

574603

});

575604605+

it("points symlinked source worktree Vitest runs at local bundled plugins", () => {

606+

expect(

607+

resolveLinkedSourceBundledPluginsEnv(

608+

{ PATH: "/usr/bin", PWD: "/repo" },

609+

{

610+

baseDir: "/repo",

611+

fsImpl: createRunVitestFs({ nodeModulesSymlink: true, bundledPlugin: true }),

612+

},

613+

),

614+

).toEqual({

615+

OPENCLAW_BUNDLED_PLUGINS_DIR: nodePath.join("/repo", "extensions"),

616+

OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR: "1",

617+

});

618+

});

619+620+

it("keeps explicit bundled plugin env ahead of symlinked worktree defaults", () => {

621+

expect(

622+

resolveLinkedSourceBundledPluginsEnv(

623+

{ OPENCLAW_BUNDLED_PLUGINS_DIR: "/custom/extensions", PATH: "/usr/bin", PWD: "/repo" },

624+

{

625+

baseDir: "/repo",

626+

fsImpl: createRunVitestFs({ nodeModulesSymlink: true, bundledPlugin: true }),

627+

},

628+

),

629+

).toEqual({});

630+

});

631+632+

it("does not add bundled plugin env for normal dependency installs", () => {

633+

expect(

634+

resolveLinkedSourceBundledPluginsEnv(

635+

{ PATH: "/usr/bin", PWD: "/repo" },

636+

{

637+

baseDir: "/repo",

638+

fsImpl: createRunVitestFs({ nodeModulesSymlink: false, bundledPlugin: true }),

639+

},

640+

),

641+

).toEqual({});

642+

});

643+576644

it("does not default explicit watch runs to the stall watchdog", () => {

577645

expect(resolveRunVitestSpawnEnv({ PATH: "/usr/bin" }, ["--watch"])).toEqual({

578646

PATH: "/usr/bin",