perf(test): reduce vitest logging overhead and media fixture cost

This commit is contained in:
Peter Steinberger
2026-02-14 00:59:53 +00:00
parent 31d8546afd
commit e8377799bb
4 changed files with 11 additions and 6 deletions

View File

@@ -37,6 +37,9 @@ function normalizeConsoleLevel(level?: string): LogLevel {
if (isVerbose()) {
return "debug";
}
if (!level && process.env.VITEST === "true" && process.env.OPENCLAW_TEST_CONSOLE !== "1") {
return "silent";
}
return normalizeLogLevel(level, "info");
}

View File

@@ -63,7 +63,9 @@ function resolveSettings(): ResolvedSettings {
cfg = undefined;
}
}
const level = normalizeLogLevel(cfg?.level, "info");
const defaultLevel =
process.env.VITEST === "true" && process.env.OPENCLAW_TEST_FILE_LOG !== "1" ? "silent" : "info";
const level = normalizeLogLevel(cfg?.level, defaultLevel);
const file = cfg?.file ?? defaultRollingPathForToday();
return { level, file };
}