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

推荐订阅源

量子位
Recent Announcements
Recent Announcements
D
Docker
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC
B
Blog
博客园_首页
罗磊的独立博客
D
DataBreaches.Net
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence

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(testing): route exact source test roots · openclaw/op...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -8,6 +8,7 @@ import os from "node:os";

88

import path from "node:path";

99

import { isChannelSurfaceTestFile } from "../test/vitest/vitest.channel-paths.mjs";

1010

import {

11+

commandsLightTestFiles,

1112

isCommandsLightTarget,

1213

resolveCommandsLightIncludePattern,

1314

} from "../test/vitest/vitest.commands-light-paths.mjs";

@@ -37,11 +38,13 @@ import { isWhatsAppExtensionRoot } from "../test/vitest/vitest.extension-whatsap

3738

import { isZaloExtensionRoot } from "../test/vitest/vitest.extension-zalo-paths.mjs";

3839

import {

3940

isPluginSdkLightTarget,

41+

pluginSdkLightTestFiles,

4042

resolvePluginSdkLightIncludePattern,

4143

} from "../test/vitest/vitest.plugin-sdk-paths.mjs";

4244

import { fullSuiteVitestShards } from "../test/vitest/vitest.test-shards.mjs";

4345

import { isUnitUiTestTarget } from "../test/vitest/vitest.ui-paths.mjs";

4446

import {

47+

getUnitFastTestFiles,

4548

resolveUnitFastTestIncludePattern,

4649

resolveUnitFastTimerTestIncludePattern,

4750

} from "../test/vitest/vitest.unit-fast-paths.mjs";

@@ -255,6 +258,10 @@ function uniqueOrdered(values) {

255258

return [...new Set(values)];

256259

}

257260261+

function isPathAtOrUnder(relative, root) {

262+

return relative === root || relative.startsWith(`${root}/`);

263+

}

264+258265

/**

259266

* Orders full-suite specs so expensive shards start first in parallel runs.

260267

*/

@@ -1179,13 +1186,66 @@ function expandExplicitSourceTestTargets(targetArgs, cwd) {

11791186

if (relative === "src/commands" && isExistingDirectoryTarget(targetArg, cwd)) {

11801187

return [COMMANDS_LIGHT_VITEST_CONFIG, COMMANDS_VITEST_CONFIG];

11811188

}

1189+

const exactDirectoryTargets = resolveExactSourceDirectoryTestTargets(targetArg, cwd);

1190+

if (exactDirectoryTargets) {

1191+

return exactDirectoryTargets;

1192+

}

11821193

const targets = resolveExplicitSourceTestTargets(targetArg, cwd, {

11831194

forceFullImportGraph,

11841195

});

11851196

return targets && targets.length > 0 ? targets : [targetArg];

11861197

});

11871198

}

118811991200+

const exactSourceDirectoryRoots = [

1201+

"src/acp",

1202+

"src/agents",

1203+

"src/auto-reply",

1204+

"src/channels",

1205+

"src/cli",

1206+

"src/commands",

1207+

"src/config",

1208+

"src/cron",

1209+

"src/daemon",

1210+

"src/gateway",

1211+

"src/hooks",

1212+

"src/infra",

1213+

"src/logging",

1214+

"src/media",

1215+

"src/media-understanding",

1216+

"src/plugin-sdk",

1217+

"src/plugins",

1218+

"src/process",

1219+

"src/secrets",

1220+

"src/shared",

1221+

"src/tasks",

1222+

"src/tui",

1223+

"src/utils",

1224+

"src/wizard",

1225+

"ui/src",

1226+

];

1227+1228+

function isExactSourceDirectoryTarget(relative) {

1229+

return exactSourceDirectoryRoots.some((root) => isPathAtOrUnder(relative, root));

1230+

}

1231+1232+

function resolveExactSourceDirectoryTestTargets(targetArg, cwd) {

1233+

if (!isExistingDirectoryTarget(targetArg, cwd)) {

1234+

return null;

1235+

}

1236+

const relative = toRepoRelativeTarget(targetArg, cwd).replace(/\/+$/u, "");

1237+

if (!isExactSourceDirectoryTarget(relative)) {

1238+

return null;

1239+

}

1240+

const prefix = `${relative}/`;

1241+

const lightTargets = uniqueOrdered([

1242+

...getUnitFastTestFiles(),

1243+

...pluginSdkLightTestFiles,

1244+

...commandsLightTestFiles,

1245+

]).filter((file) => file.startsWith(prefix));

1246+

return lightTargets.length > 0 ? [...lightTargets, targetArg] : null;

1247+

}

1248+11891249

/**

11901250

* Finds explicit test path targets that do not match any known project plan.

11911251

*/

@@ -1935,7 +1995,7 @@ function classifyTarget(arg, cwd) {

19351995

if (isControlUiE2eTarget(relative)) {

19361996

return "uiE2e";

19371997

}

1938-

if (relative.startsWith("ui/src/")) {

1998+

if (isPathAtOrUnder(relative, "ui/src")) {

19391999

if (isUnitUiTestTarget(relative)) {

19402000

return "unitUi";

19412001

}

@@ -2066,76 +2126,76 @@ function classifyTarget(arg, cwd) {

20662126

if (isBundledPluginDependentUnitTestFile(relative)) {

20672127

return "bundled";

20682128

}

2069-

if (relative.startsWith("src/channels/")) {

2129+

if (isPathAtOrUnder(relative, "src/channels")) {

20702130

return "channel";

20712131

}

2072-

if (relative.startsWith("src/gateway/")) {

2132+

if (isPathAtOrUnder(relative, "src/gateway")) {

20732133

return "gateway";

20742134

}

2075-

if (relative.startsWith("src/hooks/")) {

2135+

if (isPathAtOrUnder(relative, "src/hooks")) {

20762136

return "hooks";

20772137

}

2078-

if (relative.startsWith("src/infra/")) {

2138+

if (isPathAtOrUnder(relative, "src/infra")) {

20792139

return "infra";

20802140

}

2081-

if (relative.startsWith("src/config/")) {

2141+

if (isPathAtOrUnder(relative, "src/config")) {

20822142

return "runtimeConfig";

20832143

}

2084-

if (relative.startsWith("src/cron/")) {

2144+

if (isPathAtOrUnder(relative, "src/cron")) {

20852145

return "cron";

20862146

}

2087-

if (relative.startsWith("src/daemon/")) {

2147+

if (isPathAtOrUnder(relative, "src/daemon")) {

20882148

return "daemon";

20892149

}

2090-

if (relative.startsWith("src/media-understanding/")) {

2150+

if (isPathAtOrUnder(relative, "src/media-understanding")) {

20912151

return "mediaUnderstanding";

20922152

}

2093-

if (relative.startsWith("src/media/")) {

2153+

if (isPathAtOrUnder(relative, "src/media")) {

20942154

return "media";

20952155

}

2096-

if (relative.startsWith("src/logging/")) {

2156+

if (isPathAtOrUnder(relative, "src/logging")) {

20972157

return "logging";

20982158

}

2099-

if (relative.startsWith("src/plugin-sdk/")) {

2159+

if (isPathAtOrUnder(relative, "src/plugin-sdk")) {

21002160

return isPluginSdkLightTarget(relative) ? "pluginSdkLight" : "pluginSdk";

21012161

}

2102-

if (relative.startsWith("src/process/")) {

2162+

if (isPathAtOrUnder(relative, "src/process")) {

21032163

return "process";

21042164

}

2105-

if (relative.startsWith("src/secrets/")) {

2165+

if (isPathAtOrUnder(relative, "src/secrets")) {

21062166

return "secrets";

21072167

}

2108-

if (relative.startsWith("src/shared/")) {

2168+

if (isPathAtOrUnder(relative, "src/shared")) {

21092169

return "sharedCore";

21102170

}

2111-

if (relative.startsWith("src/tasks/")) {

2171+

if (isPathAtOrUnder(relative, "src/tasks")) {

21122172

return "tasks";

21132173

}

2114-

if (relative.startsWith("src/tui/")) {

2174+

if (isPathAtOrUnder(relative, "src/tui")) {

21152175

return "tui";

21162176

}

2117-

if (relative.startsWith("src/acp/")) {

2177+

if (isPathAtOrUnder(relative, "src/acp")) {

21182178

return "acp";

21192179

}

2120-

if (relative.startsWith("src/cli/")) {

2180+

if (isPathAtOrUnder(relative, "src/cli")) {

21212181

return "cli";

21222182

}

2123-

if (relative.startsWith("src/commands/")) {

2183+

if (isPathAtOrUnder(relative, "src/commands")) {

21242184

return isCommandsLightTarget(relative) ? "commandLight" : "command";

21252185

}

2126-

if (relative.startsWith("src/auto-reply/")) {

2186+

if (isPathAtOrUnder(relative, "src/auto-reply")) {

21272187

return "autoReply";

21282188

}

2129-

if (relative.startsWith("src/agents/")) {

2189+

if (isPathAtOrUnder(relative, "src/agents")) {

21302190

return "agent";

21312191

}

2132-

if (relative.startsWith("src/plugins/")) {

2192+

if (isPathAtOrUnder(relative, "src/plugins")) {

21332193

return "plugin";

21342194

}

2135-

if (relative.startsWith("src/utils/")) {

2195+

if (isPathAtOrUnder(relative, "src/utils")) {

21362196

return "utils";

21372197

}

2138-

if (relative.startsWith("src/wizard/")) {

2198+

if (isPathAtOrUnder(relative, "src/wizard")) {

21392199

return "wizard";

21402200

}

21412201

return "default";