perf(test): speed up config tests

This commit is contained in:
Peter Steinberger
2026-02-14 14:25:22 +00:00
parent 788ea6e9d1
commit 57f40a5da6
6 changed files with 225 additions and 270 deletions

View File

@@ -29,3 +29,16 @@ export function collectConfigEnvVars(cfg?: OpenClawConfig): Record<string, strin
return entries;
}
export function applyConfigEnvVars(
cfg: OpenClawConfig,
env: NodeJS.ProcessEnv = process.env,
): void {
const entries = collectConfigEnvVars(cfg);
for (const [key, value] of Object.entries(entries)) {
if (env[key]?.trim()) {
continue;
}
env[key] = value;
}
}