mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
fix(ci): rename extension test support for boundary guards
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
EMPTY_DISPATCH_RESULT,
|
||||
resetBlueBubblesMonitorTestState,
|
||||
type DispatchReplyParams,
|
||||
} from "./test-support/monitor.js";
|
||||
} from "./test-support/monitor-test-support.js";
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock("./send.js", () => ({
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
EMPTY_DISPATCH_RESULT,
|
||||
resetBlueBubblesMonitorTestState,
|
||||
type DispatchReplyParams,
|
||||
} from "./test-support/monitor.js";
|
||||
} from "./test-support/monitor-test-support.js";
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock("./send.js", () => ({
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
restoreFeishuLifecycleStateDir,
|
||||
setFeishuLifecycleStateDir,
|
||||
setupFeishuLifecycleHandler,
|
||||
} from "./test-support/lifecycle.js";
|
||||
} from "./test-support/lifecycle-test-support.js";
|
||||
import type { ResolvedFeishuAccount } from "./types.js";
|
||||
|
||||
const {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
restoreFeishuLifecycleStateDir,
|
||||
setFeishuLifecycleStateDir,
|
||||
setupFeishuLifecycleHandler,
|
||||
} from "./test-support/lifecycle.js";
|
||||
} from "./test-support/lifecycle-test-support.js";
|
||||
import type { ResolvedFeishuAccount } from "./types.js";
|
||||
|
||||
const {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
runFeishuLifecycleSequence,
|
||||
setFeishuLifecycleStateDir,
|
||||
setupFeishuLifecycleHandler,
|
||||
} from "./test-support/lifecycle.js";
|
||||
} from "./test-support/lifecycle-test-support.js";
|
||||
import type { FeishuConfig, ResolvedFeishuAccount } from "./types.js";
|
||||
|
||||
const {
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
restoreFeishuLifecycleStateDir,
|
||||
setFeishuLifecycleStateDir,
|
||||
setupFeishuLifecycleHandler,
|
||||
} from "./test-support/lifecycle.js";
|
||||
} from "./test-support/lifecycle-test-support.js";
|
||||
import type { ResolvedFeishuAccount } from "./types.js";
|
||||
|
||||
const {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
restoreFeishuLifecycleStateDir,
|
||||
setFeishuLifecycleStateDir,
|
||||
setupFeishuLifecycleHandler,
|
||||
} from "./test-support/lifecycle.js";
|
||||
} from "./test-support/lifecycle-test-support.js";
|
||||
import type { ResolvedFeishuAccount } from "./types.js";
|
||||
|
||||
const {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
resolveAgentRoute,
|
||||
setActivePluginRegistry,
|
||||
type OpenClawConfig,
|
||||
} from "../../test-support/monitor-route.js";
|
||||
} from "../../test-support/monitor-route-test-support.js";
|
||||
import { resolveMatrixInboundRoute } from "./route.js";
|
||||
|
||||
const baseCfg = {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export {
|
||||
__testing,
|
||||
createTestRegistry,
|
||||
registerSessionBindingAdapter,
|
||||
resolveAgentRoute,
|
||||
setActivePluginRegistry,
|
||||
type OpenClawConfig,
|
||||
} from "../../../../test/helpers/plugins/matrix-monitor-route.js";
|
||||
@@ -1,8 +0,0 @@
|
||||
export type { OpenClawConfig } from "../../../../src/config/config.js";
|
||||
export {
|
||||
__testing,
|
||||
registerSessionBindingAdapter,
|
||||
} from "../../../../src/infra/outbound/session-binding-service.js";
|
||||
export { setActivePluginRegistry } from "../../../../src/plugins/runtime.js";
|
||||
export { resolveAgentRoute } from "../../../../src/routing/resolve-route.js";
|
||||
export { createTestRegistry } from "../../../../src/test-utils/channel-plugins.js";
|
||||
@@ -1,3 +1,3 @@
|
||||
import { describeOpenAIProviderCatalogContract } from "./test-support/provider-catalog.contract.js";
|
||||
import { describeOpenAIProviderCatalogContract } from "./test-support/provider-catalog.contract-test-support.js";
|
||||
|
||||
describeOpenAIProviderCatalogContract();
|
||||
|
||||
@@ -3,9 +3,10 @@ import {
|
||||
expectAugmentedCodexCatalog,
|
||||
expectCodexBuiltInSuppression,
|
||||
expectCodexMissingAuthHint,
|
||||
} from "../../../src/plugins/provider-runtime.test-support.js";
|
||||
import type { ProviderPlugin } from "../../../src/plugins/types.js";
|
||||
import { loadBundledPluginPublicSurfaceSync } from "../../../src/test-utils/bundled-plugin-public-surface.js";
|
||||
importProviderRuntimeCatalogModule,
|
||||
loadBundledPluginPublicSurfaceSync,
|
||||
} from "../../../test/helpers/plugins/provider-catalog.js";
|
||||
import type { ProviderPlugin } from "../../../test/helpers/plugins/provider-catalog.js";
|
||||
import {
|
||||
registerProviderPlugin,
|
||||
requireRegisteredProvider,
|
||||
@@ -13,12 +14,9 @@ import {
|
||||
|
||||
const PROVIDER_CATALOG_CONTRACT_TIMEOUT_MS = 300_000;
|
||||
|
||||
type ResolvePluginProviders =
|
||||
typeof import("../../../src/plugins/providers.runtime.js").resolvePluginProviders;
|
||||
type ResolveOwningPluginIdsForProvider =
|
||||
typeof import("../../../src/plugins/providers.js").resolveOwningPluginIdsForProvider;
|
||||
type ResolveCatalogHookProviderPluginIds =
|
||||
typeof import("../../../src/plugins/providers.js").resolveCatalogHookProviderPluginIds;
|
||||
type ResolvePluginProviders = (params?: { onlyPluginIds?: string[] }) => ProviderPlugin[];
|
||||
type ResolveOwningPluginIdsForProvider = (params: { provider: string }) => string[] | undefined;
|
||||
type ResolveCatalogHookProviderPluginIds = (params: unknown) => string[];
|
||||
|
||||
const resolvePluginProvidersMock = vi.hoisted(() => vi.fn<ResolvePluginProviders>(() => []));
|
||||
const resolveOwningPluginIdsForProviderMock = vi.hoisted(() =>
|
||||
@@ -40,9 +38,15 @@ vi.mock("../../../src/plugins/providers.runtime.js", () => ({
|
||||
}));
|
||||
|
||||
export function describeOpenAIProviderCatalogContract() {
|
||||
let augmentModelCatalogWithProviderPlugins: typeof import("../../../src/plugins/provider-runtime.js").augmentModelCatalogWithProviderPlugins;
|
||||
let resetProviderRuntimeHookCacheForTest: typeof import("../../../src/plugins/provider-runtime.js").resetProviderRuntimeHookCacheForTest;
|
||||
let resolveProviderBuiltInModelSuppression: typeof import("../../../src/plugins/provider-runtime.js").resolveProviderBuiltInModelSuppression;
|
||||
let augmentModelCatalogWithProviderPlugins: Awaited<
|
||||
ReturnType<typeof importProviderRuntimeCatalogModule>
|
||||
>["augmentModelCatalogWithProviderPlugins"];
|
||||
let resetProviderRuntimeHookCacheForTest: Awaited<
|
||||
ReturnType<typeof importProviderRuntimeCatalogModule>
|
||||
>["resetProviderRuntimeHookCacheForTest"];
|
||||
let resolveProviderBuiltInModelSuppression: Awaited<
|
||||
ReturnType<typeof importProviderRuntimeCatalogModule>
|
||||
>["resolveProviderBuiltInModelSuppression"];
|
||||
let openaiProviders: ProviderPlugin[];
|
||||
let openaiProvider: ProviderPlugin;
|
||||
|
||||
@@ -68,7 +72,7 @@ export function describeOpenAIProviderCatalogContract() {
|
||||
augmentModelCatalogWithProviderPlugins,
|
||||
resetProviderRuntimeHookCacheForTest,
|
||||
resolveProviderBuiltInModelSuppression,
|
||||
} = await import("../../../src/plugins/provider-runtime.js"));
|
||||
} = await importProviderRuntimeCatalogModule());
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -5,14 +5,14 @@ import {
|
||||
createImageUpdate,
|
||||
createLifecycleMonitorSetup,
|
||||
expectImageLifecycleDelivery,
|
||||
} from "../test-support/lifecycle.js";
|
||||
} from "../test-support/lifecycle-test-support.js";
|
||||
import {
|
||||
getUpdatesMock,
|
||||
getZaloRuntimeMock,
|
||||
loadLifecycleMonitorModule,
|
||||
resetLifecycleTestState,
|
||||
sendMessageMock,
|
||||
} from "../test-support/monitor-mocks.js";
|
||||
} from "../test-support/monitor-mocks-test-support.js";
|
||||
|
||||
describe("Zalo polling image handling", () => {
|
||||
const {
|
||||
|
||||
@@ -5,13 +5,13 @@ import {
|
||||
createTextUpdate,
|
||||
postWebhookReplay,
|
||||
settleAsyncWork,
|
||||
} from "../test-support/lifecycle.js";
|
||||
} from "../test-support/lifecycle-test-support.js";
|
||||
import {
|
||||
resetLifecycleTestState,
|
||||
sendMessageMock,
|
||||
setLifecycleRuntimeCore,
|
||||
startWebhookLifecycleMonitor,
|
||||
} from "../test-support/monitor-mocks.js";
|
||||
} from "../test-support/monitor-mocks-test-support.js";
|
||||
|
||||
describe("Zalo pairing lifecycle", () => {
|
||||
const readAllowFromStoreMock = vi.fn(async () => [] as string[]);
|
||||
|
||||
@@ -6,13 +6,13 @@ import {
|
||||
createTextUpdate,
|
||||
postWebhookReplay,
|
||||
settleAsyncWork,
|
||||
} from "../test-support/lifecycle.js";
|
||||
} from "../test-support/lifecycle-test-support.js";
|
||||
import {
|
||||
resetLifecycleTestState,
|
||||
sendMessageMock,
|
||||
setLifecycleRuntimeCore,
|
||||
startWebhookLifecycleMonitor,
|
||||
} from "../test-support/monitor-mocks.js";
|
||||
} from "../test-support/monitor-mocks-test-support.js";
|
||||
|
||||
describe("Zalo reply-once lifecycle", () => {
|
||||
const finalizeInboundContextMock = vi.fn((ctx: Record<string, unknown>) => ctx);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
createTextUpdate,
|
||||
expectImageLifecycleDelivery,
|
||||
postWebhookReplay,
|
||||
} from "../test-support/lifecycle.js";
|
||||
} from "../test-support/lifecycle-test-support.js";
|
||||
import {
|
||||
clearZaloWebhookSecurityStateForTest,
|
||||
getZaloWebhookRateLimitStateSizeForTest,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/zalo";
|
||||
import { vi } from "vitest";
|
||||
import { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
|
||||
import { setActivePluginRegistry } from "../../../src/plugins/runtime.js";
|
||||
import {
|
||||
createEmptyPluginRegistry,
|
||||
setActivePluginRegistry,
|
||||
} from "../../../test/helpers/plugins/plugin-registry.js";
|
||||
import { createPluginRuntimeMock } from "../../../test/helpers/plugins/plugin-runtime-mock.js";
|
||||
import { createRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
|
||||
import type { ResolvedZaloAccount } from "../src/types.js";
|
||||
8
test/helpers/plugins/matrix-monitor-route.ts
Normal file
8
test/helpers/plugins/matrix-monitor-route.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
export {
|
||||
__testing,
|
||||
registerSessionBindingAdapter,
|
||||
} from "../../../src/infra/outbound/session-binding-service.js";
|
||||
export { setActivePluginRegistry } from "../../../src/plugins/runtime.js";
|
||||
export { resolveAgentRoute } from "../../../src/routing/resolve-route.js";
|
||||
export { createTestRegistry } from "../../../src/test-utils/channel-plugins.js";
|
||||
2
test/helpers/plugins/plugin-registry.ts
Normal file
2
test/helpers/plugins/plugin-registry.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
|
||||
export { setActivePluginRegistry } from "../../../src/plugins/runtime.js";
|
||||
27
test/helpers/plugins/provider-catalog.ts
Normal file
27
test/helpers/plugins/provider-catalog.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export {
|
||||
expectAugmentedCodexCatalog,
|
||||
expectCodexBuiltInSuppression,
|
||||
expectCodexMissingAuthHint,
|
||||
} from "../../../src/plugins/provider-runtime.test-support.js";
|
||||
export type { ProviderPlugin } from "../../../src/plugins/types.js";
|
||||
export { loadBundledPluginPublicSurfaceSync } from "../../../src/test-utils/bundled-plugin-public-surface.js";
|
||||
|
||||
type ProviderRuntimeCatalogModule = Pick<
|
||||
typeof import("../../../src/plugins/provider-runtime.js"),
|
||||
| "augmentModelCatalogWithProviderPlugins"
|
||||
| "resetProviderRuntimeHookCacheForTest"
|
||||
| "resolveProviderBuiltInModelSuppression"
|
||||
>;
|
||||
|
||||
export async function importProviderRuntimeCatalogModule(): Promise<ProviderRuntimeCatalogModule> {
|
||||
const {
|
||||
augmentModelCatalogWithProviderPlugins,
|
||||
resetProviderRuntimeHookCacheForTest,
|
||||
resolveProviderBuiltInModelSuppression,
|
||||
} = await import("../../../src/plugins/provider-runtime.js");
|
||||
return {
|
||||
augmentModelCatalogWithProviderPlugins,
|
||||
resetProviderRuntimeHookCacheForTest,
|
||||
resolveProviderBuiltInModelSuppression,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user