mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
perf(test): reduce vitest logging overhead and media fixture cost
This commit is contained in:
@@ -67,7 +67,7 @@ describe("logger helpers", () => {
|
||||
|
||||
it("uses daily rolling default log file and prunes old ones", () => {
|
||||
resetLogger();
|
||||
setLoggerOverride({}); // force defaults regardless of user config
|
||||
setLoggerOverride({ level: "info" }); // force default file path with enabled file logging
|
||||
const today = localDateString(new Date());
|
||||
const todayPath = path.join(DEFAULT_LOG_DIR, `openclaw-${today}.log`);
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
@@ -146,8 +146,8 @@ describe("web auto-reply", () => {
|
||||
|
||||
const smallPng = await sharp({
|
||||
create: {
|
||||
width: 200,
|
||||
height: 200,
|
||||
width: 64,
|
||||
height: 64,
|
||||
channels: 3,
|
||||
background: { r: 0, g: 255, b: 0 },
|
||||
},
|
||||
@@ -251,8 +251,8 @@ describe("web auto-reply", () => {
|
||||
|
||||
const bigPng = await sharp({
|
||||
create: {
|
||||
width: 3200,
|
||||
height: 3200,
|
||||
width: 2000,
|
||||
height: 2000,
|
||||
channels: 3,
|
||||
background: { r: 255, g: 0, b: 0 },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user