test: route oauth helper env setup · openclaw/openclaw@0100c27
shakkernerd
·
2026-06-15
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,7 @@ import fs from "node:fs/promises";
|
7 | 7 | import os from "node:os"; |
8 | 8 | import path from "node:path"; |
9 | 9 | import { closeOpenClawAgentDatabasesForTest } from "../../state/openclaw-agent-db.js"; |
| 10 | +import { setTestEnvValue } from "../../test-utils/env.js"; |
10 | 11 | import type { resolveApiKeyForProfile } from "./oauth.js"; |
11 | 12 | import { loadPersistedAuthProfileStore } from "./persisted.js"; |
12 | 13 | import { saveAuthProfileStore } from "./store.js"; |
@@ -73,8 +74,8 @@ export async function createOAuthTestTempRoot(prefix: string): Promise<string> {
|
73 | 74 | /** Create and export the main agent dir for OAuth tests. */ |
74 | 75 | export async function createOAuthMainAgentDir(stateDir: string): Promise<string> { |
75 | 76 | const agentDir = path.join(stateDir, "agents", "main", "agent"); |
76 | | -process.env.OPENCLAW_STATE_DIR = stateDir; |
77 | | -process.env.OPENCLAW_AGENT_DIR = agentDir; |
| 77 | +setTestEnvValue("OPENCLAW_STATE_DIR", stateDir); |
| 78 | +setTestEnvValue("OPENCLAW_AGENT_DIR", agentDir); |
78 | 79 | await fs.mkdir(agentDir, { recursive: true }); |
79 | 80 | return agentDir; |
80 | 81 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。