mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:20:43 +00:00
test: route extension tests through sdk subpaths
This commit is contained in:
@@ -2,13 +2,13 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
firstWrittenJsonArg,
|
||||
spyRuntimeErrors,
|
||||
spyRuntimeJson,
|
||||
spyRuntimeLogs,
|
||||
} from "../../../src/cli/test-runtime-capture.js";
|
||||
} from "openclaw/plugin-sdk/testing";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { readShortTermRecallEntries, recordShortTermRecalls } from "./short-term-promotion.js";
|
||||
|
||||
const getMemorySearchManager = vi.hoisted(() => vi.fn());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import fs from "node:fs";
|
||||
import { type JsonSchemaObject, validateJsonSchemaValue } from "openclaw/plugin-sdk/config-schema";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { validateJsonSchemaValue } from "../../../src/plugins/schema-validator.js";
|
||||
import type { JsonSchemaObject } from "../../../src/shared/json-schema.types.js";
|
||||
|
||||
const manifest = JSON.parse(
|
||||
fs.readFileSync(new URL("../openclaw.plugin.json", import.meta.url), "utf-8"),
|
||||
|
||||
@@ -5,11 +5,11 @@ import {
|
||||
RequestScopedSubagentRuntimeError,
|
||||
SUBAGENT_RUNTIME_REQUEST_SCOPE_ERROR_CODE,
|
||||
} from "openclaw/plugin-sdk/error-runtime";
|
||||
import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
|
||||
import * as memoryCoreHostRuntimeCoreModule from "openclaw/plugin-sdk/memory-core-host-runtime-core";
|
||||
import * as runtimeConfigSnapshotModule from "openclaw/plugin-sdk/runtime-config-snapshot";
|
||||
import * as sessionStoreRuntimeModule from "openclaw/plugin-sdk/session-store-runtime";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { resolveGlobalMap } from "../../../src/shared/global-singleton.js";
|
||||
import {
|
||||
appendNarrativeEntry,
|
||||
buildBackfillDiaryEntry,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
|
||||
import type { MemoryEmbeddingProviderAdapter } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../../../src/config/types.openclaw.js";
|
||||
import { createEmbeddingProvider } from "./embeddings.js";
|
||||
|
||||
const mockEmbeddingRegistry = vi.hoisted(() => ({
|
||||
|
||||
@@ -3,12 +3,12 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { resolveSessionTranscriptsDirForAgent } from "openclaw/plugin-sdk/memory-core";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
clearMemoryEmbeddingProviders as clearRegistry,
|
||||
listMemoryEmbeddingProviders as listRegisteredAdapters,
|
||||
registerMemoryEmbeddingProvider as registerAdapter,
|
||||
} from "../../../../src/plugins/memory-embedding-providers.js";
|
||||
} from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import "./test-runtime-mocks.js";
|
||||
import type { MemoryIndexManager } from "./index.js";
|
||||
import { closeAllMemorySearchManagers, getMemorySearchManager } from "./index.js";
|
||||
|
||||
@@ -64,7 +64,7 @@ vi.mock("./embeddings.js", () => ({
|
||||
|
||||
type MemoryIndexModule = typeof import("./index.js");
|
||||
type MemoryEmbeddingProvidersModule =
|
||||
typeof import("../../../../src/plugins/memory-embedding-providers.js");
|
||||
typeof import("openclaw/plugin-sdk/memory-core-host-engine-embeddings");
|
||||
|
||||
let getMemorySearchManager: MemoryIndexModule["getMemorySearchManager"];
|
||||
let closeAllMemorySearchManagers: MemoryIndexModule["closeAllMemorySearchManagers"];
|
||||
@@ -82,7 +82,7 @@ describe("memory watcher config", () => {
|
||||
({
|
||||
clearMemoryEmbeddingProviders: clearRegistry,
|
||||
registerMemoryEmbeddingProvider: registerAdapter,
|
||||
} = await import("../../../../src/plugins/memory-embedding-providers.js"));
|
||||
} = await import("openclaw/plugin-sdk/memory-core-host-engine-embeddings"));
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
clearMemoryPluginState,
|
||||
registerMemoryCorpusSupplement,
|
||||
} from "../../../src/plugins/memory-state.js";
|
||||
} from "openclaw/plugin-sdk/memory-host-core";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
getMemorySearchManagerMockCalls,
|
||||
getReadAgentMemoryFileMockCalls,
|
||||
|
||||
Reference in New Issue
Block a user