mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
test: snapshot task flow audit env
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Covers managed task-flow audit summaries and stale-flow classification.
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js";
|
||||
import { createRunningTaskRun as createRunningTaskRunOrNull } from "./task-executor.js";
|
||||
import {
|
||||
@@ -20,7 +21,7 @@ import {
|
||||
} from "./task-registry.js";
|
||||
import type { TaskRecord } from "./task-registry.types.js";
|
||||
|
||||
const ORIGINAL_STATE_DIR = process.env.OPENCLAW_STATE_DIR;
|
||||
const ORIGINAL_ENV = captureEnv(["OPENCLAW_STATE_DIR"]);
|
||||
|
||||
function createManagedTaskFlow(
|
||||
params: Parameters<typeof createManagedTaskFlowOrNull>[0],
|
||||
@@ -80,11 +81,7 @@ async function withTaskFlowAuditStateDir(run: (root: string) => Promise<void>):
|
||||
|
||||
describe("task-flow-registry audit", () => {
|
||||
afterEach(() => {
|
||||
if (ORIGINAL_STATE_DIR === undefined) {
|
||||
delete process.env.OPENCLAW_STATE_DIR;
|
||||
} else {
|
||||
process.env.OPENCLAW_STATE_DIR = ORIGINAL_STATE_DIR;
|
||||
}
|
||||
ORIGINAL_ENV.restore();
|
||||
resetTaskRegistryDeliveryRuntimeForTests();
|
||||
resetTaskRegistryForTests();
|
||||
resetTaskFlowRegistryForTests();
|
||||
|
||||
Reference in New Issue
Block a user