惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: isolate crestodian state env · openclaw/openclaw@fa...
shakkernerd · 2026-06-25 · via Recent Commits to openclaw:main

@@ -4,6 +4,7 @@ import os from "node:os";

44

import path from "node:path";

55

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

66

import type { RuntimeEnv } from "../runtime.js";

7+

import { captureEnv, setTestEnvValue } from "../test-utils/env.js";

78

import { createCrestodianTestRuntime } from "./crestodian.test-helpers.js";

89

import { executeCrestodianOperation, parseCrestodianOperation } from "./operations.js";

910

@@ -192,12 +193,16 @@ vi.mock("../config/model-input.js", () => ({

192193

}));

193194194195

describe("parseCrestodianOperation", () => {

196+

let stateDirSnapshot: ReturnType<typeof captureEnv> | undefined;

197+195198

beforeEach(() => {

196199

mockConfig.reset();

200+

stateDirSnapshot = captureEnv(["OPENCLAW_STATE_DIR"]);

197201

vi.stubEnv("OPENCLAW_TEST_FAST", "1");

198202

});

199203200204

afterEach(() => {

205+

stateDirSnapshot?.restore();

201206

vi.unstubAllEnvs();

202207

});

203208

@@ -321,7 +326,7 @@ describe("parseCrestodianOperation", () => {

321326322327

it("applies config set through typed deps and writes an audit entry", async () => {

323328

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-config-set-"));

324-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

329+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

325330

const { runtime, lines } = createCrestodianTestRuntime();

326331

const runConfigSet = vi.fn(async () => {});

327332

@@ -357,7 +362,7 @@ describe("parseCrestodianOperation", () => {

357362358363

it("applies SecretRef config set through typed deps and writes an audit entry", async () => {

359364

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-config-ref-"));

360-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

365+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

361366

const { runtime, lines } = createCrestodianTestRuntime();

362367

const runConfigSet = vi.fn(async () => {});

363368

@@ -435,7 +440,7 @@ describe("parseCrestodianOperation", () => {

435440436441

it("installs plugins only after approval and audits the write", async () => {

437442

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-plugin-install-"));

438-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

443+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

439444

const { runtime, lines } = createCrestodianTestRuntime();

440445

const runPluginInstall = vi.fn(async (spec: string, pluginRuntime: RuntimeEnv) => {

441446

pluginRuntime.log(`installed ${spec}`);

@@ -481,7 +486,7 @@ describe("parseCrestodianOperation", () => {

481486482487

it("uninstalls plugins only after approval and audits the write", async () => {

483488

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-plugin-uninstall-"));

484-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

489+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

485490

const { runtime, lines } = createCrestodianTestRuntime();

486491

const runPluginUninstall = vi.fn(async (pluginId: string, pluginRuntime: RuntimeEnv) => {

487492

pluginRuntime.log(`uninstalled ${pluginId}`);

@@ -527,7 +532,7 @@ describe("parseCrestodianOperation", () => {

527532528533

it("runs setup bootstrap only after approval and audits it", async () => {

529534

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-setup-"));

530-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

535+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

531536

vi.stubEnv("OPENAI_API_KEY", "test-key");

532537

const { runtime, lines } = createCrestodianTestRuntime();

533538

@@ -576,7 +581,7 @@ describe("parseCrestodianOperation", () => {

576581577582

it("runs doctor repairs only after approval and audits them", async () => {

578583

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-doctor-fix-"));

579-

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

584+

setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);

580585

const { runtime, lines } = createCrestodianTestRuntime();

581586

const runDoctor = vi.fn(async () => {});

582587