mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 19:10:45 +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
72
openclaw/scripts/test-extension-batch.mjs
Normal file
72
openclaw/scripts/test-extension-batch.mjs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { resolveExtensionBatchPlan } from "./lib/extension-test-plan.mjs";
|
||||
import { isDirectScriptRun, runVitestBatch } from "./lib/vitest-batch-runner.mjs";
|
||||
|
||||
function printUsage() {
|
||||
console.error("Usage: pnpm test:extensions:batch <extension[,extension...]> [vitest args...]");
|
||||
console.error(
|
||||
" node scripts/test-extension-batch.mjs <extension[,extension...]> [vitest args...]",
|
||||
);
|
||||
}
|
||||
|
||||
function parseExtensionIds(rawArgs) {
|
||||
const args = [...rawArgs];
|
||||
const extensionIds = [];
|
||||
|
||||
while (args[0] && !args[0].startsWith("-")) {
|
||||
extensionIds.push(
|
||||
...args
|
||||
.shift()
|
||||
.split(",")
|
||||
.map((value) => value.trim())
|
||||
.filter(Boolean),
|
||||
);
|
||||
}
|
||||
|
||||
return { extensionIds, passthroughArgs: args };
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const rawArgs = process.argv.slice(2);
|
||||
if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
const passthroughArgs = rawArgs.filter((arg) => arg !== "--");
|
||||
const { extensionIds, passthroughArgs: vitestArgs } = parseExtensionIds(passthroughArgs);
|
||||
if (extensionIds.length === 0) {
|
||||
printUsage();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const batchPlan = resolveExtensionBatchPlan({ cwd: process.cwd(), extensionIds });
|
||||
if (!batchPlan.hasTests) {
|
||||
console.log("[test-extension-batch] No tests found for the requested extensions. Skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
`[test-extension-batch] Running ${batchPlan.testFileCount} test files across ${batchPlan.extensionCount} extensions`,
|
||||
);
|
||||
|
||||
for (const group of batchPlan.planGroups) {
|
||||
console.log(
|
||||
`[test-extension-batch] ${group.config}: ${group.extensionIds.join(", ")} (${group.testFileCount} files)`,
|
||||
);
|
||||
const exitCode = await runVitestBatch({
|
||||
args: vitestArgs,
|
||||
config: group.config,
|
||||
env: process.env,
|
||||
targets: group.roots,
|
||||
});
|
||||
if (exitCode !== 0) {
|
||||
process.exit(exitCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isDirectScriptRun(import.meta.url)) {
|
||||
await run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue