mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-20 04:34:25 -04:00
a9ae1a6778
Matrix Protocol: - docker-compose.matrix.yml: Dendrite homeserver + PostgreSQL + Nginx TLS - src/channels/plugins/matrix-channel.ts: OpenClaw plugin implementation - docs/matrix-triad-setup.md: Setup guide with auth scheme (@tm1-4:triad.local) MCP Server Integration: - docs/mcp-triad-integration.md: SearXNG, Playwright, GitHub MCP configs - docs/mcp-curiosity-mapping.md: Gap-to-capability mapping Node Sync Architecture: - src/services/node-sync-service.ts: WebSocket peer sync + presence detection - src/services/node-sync-service.test.ts: Unit tests - docs/node-sync-architecture.md: Architecture docs Triad Resilience: - scripts/triad-corruption-check.mjs: SQLite + log + config + git integrity - docs/triad-resilience.md: Recovery procedures - .secure/deployment-logs/README.md: Schema v2 - skills/triad-heartbeat/SKILL.md: Corruption check integration NPM Publish Workflow: - scripts/npm-publish.mjs: version, changelog, validate, publish, rollback - .github/workflows/npm-publish.yml: GitHub Actions with provenance - docs/npm-publish-guide.md: Complete documentation All deliverables tested in Docker before production.
63 lines
1.7 KiB
JavaScript
Executable File
63 lines
1.7 KiB
JavaScript
Executable File
import {
|
|
collectVitestFileDurations,
|
|
readJsonFile,
|
|
runVitestJsonReport,
|
|
} from "./test-report-utils.mjs";
|
|
|
|
function parseArgs(argv) {
|
|
const args = {
|
|
config: "vitest.unit.config.ts",
|
|
limit: 20,
|
|
reportPath: "",
|
|
};
|
|
for (let i = 0; i < argv.length; i += 1) {
|
|
const arg = argv[i];
|
|
if (arg === "--config") {
|
|
args.config = argv[i + 1] ?? args.config;
|
|
i += 1;
|
|
continue;
|
|
}
|
|
if (arg === "--limit") {
|
|
const parsed = Number.parseInt(argv[i + 1] ?? "", 10);
|
|
if (Number.isFinite(parsed) && parsed > 0) {
|
|
args.limit = parsed;
|
|
}
|
|
i += 1;
|
|
continue;
|
|
}
|
|
if (arg === "--report") {
|
|
args.reportPath = argv[i + 1] ?? "";
|
|
i += 1;
|
|
continue;
|
|
}
|
|
}
|
|
return args;
|
|
}
|
|
|
|
function formatMs(value) {
|
|
return `${value.toFixed(1)}ms`;
|
|
}
|
|
|
|
const opts = parseArgs(process.argv.slice(2));
|
|
const reportPath = runVitestJsonReport({
|
|
config: opts.config,
|
|
reportPath: opts.reportPath,
|
|
prefix: "openclaw-vitest-hotspots",
|
|
});
|
|
const report = readJsonFile(reportPath);
|
|
const fileResults = collectVitestFileDurations(report).toSorted(
|
|
(a, b) => b.durationMs - a.durationMs,
|
|
);
|
|
|
|
const top = fileResults.slice(0, opts.limit);
|
|
const totalDurationMs = fileResults.reduce((sum, item) => sum + item.durationMs, 0);
|
|
console.log(
|
|
`\n[test-hotspots] top ${String(top.length)} by file duration (${formatMs(totalDurationMs)} total)`,
|
|
);
|
|
for (const [index, item] of top.entries()) {
|
|
const label = String(index + 1).padStart(2, " ");
|
|
const duration = formatMs(item.durationMs).padStart(10, " ");
|
|
const tests = String(item.testCount).padStart(4, " ");
|
|
console.log(`${label}. ${duration} | tests=${tests} | ${item.file}`);
|
|
}
|