mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 18:46:07 +00:00
revert(test): restore session plugin cleanup
This commit is contained in:
@@ -3,18 +3,14 @@
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, test, vi } from "vitest";
|
||||
import { afterEach, beforeAll, describe, expect, test, vi } from "vitest";
|
||||
import { writeAcpSessionMetaForMigration } from "../acp/runtime/session-meta.js";
|
||||
import { resetConfigRuntimeState, setRuntimeConfigSnapshot } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { loadSessionStore, type SessionEntry } from "../config/sessions.js";
|
||||
import { writeSessionStoreForTest } from "../config/sessions/test-helpers.js";
|
||||
import { createEmptyPluginRegistry } from "../plugins/registry-empty.js";
|
||||
import {
|
||||
getActivePluginRegistry,
|
||||
resetPluginRuntimeStateForTest,
|
||||
setActivePluginRegistry,
|
||||
} from "../plugins/runtime.js";
|
||||
import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { withStateDirEnv } from "../test-helpers/state-dir-env.js";
|
||||
import {
|
||||
canonicalizeSpawnedByForAgent,
|
||||
@@ -105,10 +101,8 @@ function expectFields(value: unknown, expected: Record<string, unknown>): void {
|
||||
}
|
||||
|
||||
describe("gateway session utils", () => {
|
||||
const emptyPluginRegistry = createEmptyPluginRegistry();
|
||||
|
||||
beforeAll(() => {
|
||||
setActivePluginRegistry(emptyPluginRegistry);
|
||||
setActivePluginRegistry(createEmptyPluginRegistry());
|
||||
listSessionsFromStore({
|
||||
cfg: createModelDefaultsConfig({ primary: "anthropic/claude-sonnet-4.6" }),
|
||||
storePath: "",
|
||||
@@ -123,16 +117,11 @@ describe("gateway session utils", () => {
|
||||
opts: {},
|
||||
});
|
||||
resetConfigRuntimeState();
|
||||
resetPluginRuntimeStateForTest();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
resetConfigRuntimeState();
|
||||
if (getActivePluginRegistry() !== emptyPluginRegistry) {
|
||||
setActivePluginRegistry(emptyPluginRegistry);
|
||||
}
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
resetPluginRuntimeStateForTest();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user