test: route extension tests through sdk subpaths · openclaw/openclaw@74e62c3
steipete
·
2026-04-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
| 2 | +import { type JsonSchemaObject, validateJsonSchemaValue } from "openclaw/plugin-sdk/config-schema"; |
2 | 3 | import { describe, expect, it } from "vitest"; |
3 | | -import { validateJsonSchemaValue } from "../../src/plugins/schema-validator.js"; |
4 | | -import type { JsonSchemaObject } from "../../src/shared/json-schema.types.js"; |
5 | 4 | |
6 | 5 | const manifest = JSON.parse( |
7 | 6 | fs.readFileSync(new URL("./openclaw.plugin.json", import.meta.url), "utf-8"), |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { readFileSync } from "node:fs"; |
2 | 2 | import { resolve } from "node:path"; |
| 3 | +import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; |
| 4 | +import type { PluginRuntime } from "openclaw/plugin-sdk/core"; |
| 5 | +import { buildPluginApi } from "openclaw/plugin-sdk/testing"; |
3 | 6 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
4 | | -import type { OpenClawConfig } from "../../src/config/config.js"; |
5 | | -import { buildPluginApi } from "../../src/plugins/api-builder.js"; |
6 | | -import type { PluginRuntime } from "../../src/plugins/runtime/types.js"; |
7 | 7 | import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js"; |
8 | 8 | import { resetBedrockDiscoveryCacheForTest } from "./discovery.js"; |
9 | 9 | import amazonBedrockPlugin from "./index.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { resolveProviderAuthEnvVarCandidates } from "openclaw/plugin-sdk/provider-env-vars"; |
| 2 | +import { resolveProviderPluginChoice } from "openclaw/plugin-sdk/testing"; |
1 | 3 | import { describe, expect, it } from "vitest"; |
2 | | -import { resolveProviderPluginChoice } from "../../src/plugins/provider-auth-choice.runtime.js"; |
3 | | -import { resolveProviderAuthEnvVarCandidates } from "../../src/secrets/provider-env-vars.js"; |
4 | 4 | import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js"; |
5 | 5 | import { runSingleProviderCatalog } from "../test-support/provider-model-test-helpers.js"; |
6 | 6 | import arceePlugin from "./index.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing"; |
1 | 2 | import { describe, expect, it } from "vitest"; |
2 | | -import { isLiveTestEnabled } from "../../src/agents/live-test-helpers.js"; |
3 | 3 | import { |
4 | 4 | registerProviderPlugin, |
5 | 5 | requireRegisteredProvider, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
| 2 | +import { validateJsonSchemaValue } from "openclaw/plugin-sdk/config-schema"; |
2 | 3 | import { afterEach, describe, expect, it, vi } from "vitest"; |
3 | | -import { validateJsonSchemaValue } from "../../../src/plugins/schema-validator.js"; |
4 | 4 | import { __testing } from "../test-api.js"; |
5 | 5 | import { createBraveWebSearchProvider } from "./brave-web-search-provider.js"; |
6 | 6 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs/promises"; |
2 | 2 | import net from "node:net"; |
3 | 3 | import path from "node:path"; |
| 4 | +import { clearConfigCache, clearRuntimeConfigSnapshot } from "openclaw/plugin-sdk/config-runtime"; |
4 | 5 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
5 | | -import { clearConfigCache, clearRuntimeConfigSnapshot } from "../../../../src/config/config.js"; |
6 | 6 | import { createTempHomeEnv } from "../../test-support.js"; |
7 | 7 | import { stopBrowserControlService } from "../control-service.js"; |
8 | 8 | import { fetchBrowserJson } from "./client-fetch.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { completeSimple, type Model } from "@mariozechner/pi-ai"; |
2 | | -import { describe, expect, it } from "vitest"; |
3 | 2 | import { |
4 | 3 | createSingleUserPromptMessage, |
5 | 4 | extractNonEmptyAssistantText, |
6 | 5 | isLiveTestEnabled, |
7 | | -} from "../../src/agents/live-test-helpers.js"; |
| 6 | +} from "openclaw/plugin-sdk/testing"; |
| 7 | +import { describe, expect, it } from "vitest"; |
8 | 8 | import { BYTEPLUS_CODING_BASE_URL, BYTEPLUS_DEFAULT_COST } from "./models.js"; |
9 | 9 | |
10 | 10 | const BYTEPLUS_KEY = process.env.BYTEPLUS_API_KEY ?? ""; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs/promises"; |
2 | 2 | import os from "node:os"; |
3 | 3 | import path from "node:path"; |
| 4 | +import type { HarnessContextEngine as ContextEngine } from "openclaw/plugin-sdk/agent-harness-runtime"; |
4 | 5 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
5 | | -import type { ContextEngine } from "../../../../src/context-engine/types.js"; |
6 | 6 | import type { CodexAppServerClient } from "./client.js"; |
7 | 7 | import { maybeCompactCodexAppServerSession, __testing } from "./compact.js"; |
8 | 8 | import type { CodexServerNotification } from "./protocol.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,8 +3,8 @@ import os from "node:os";
|
3 | 3 | import path from "node:path"; |
4 | 4 | import { SessionManager } from "@mariozechner/pi-coding-agent"; |
5 | 5 | import type { EmbeddedRunAttemptParams } from "openclaw/plugin-sdk/agent-harness"; |
| 6 | +import { isSilentReplyPayloadText } from "openclaw/plugin-sdk/reply-chunking"; |
6 | 7 | import { afterEach, describe, expect, it } from "vitest"; |
7 | | -import { isSilentReplyPayloadText } from "../../../../src/auto-reply/tokens.js"; |
8 | 8 | import { DELIVERY_NO_REPLY_RUNTIME_CONTRACT } from "../../../../test/helpers/agents/delivery-no-reply-runtime-contract.js"; |
9 | 9 | import { CodexAppServerEventProjector } from "./event-projector.js"; |
10 | 10 | import { createCodexTestModel } from "./test-support.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { AgentToolResult } from "@mariozechner/pi-agent-core"; |
2 | 2 | import type { AnyAgentTool } from "openclaw/plugin-sdk/agent-harness"; |
3 | | -import { afterEach, describe, expect, it, vi } from "vitest"; |
4 | | -import { wrapToolWithBeforeToolCallHook } from "../../../../src/agents/pi-tools.before-tool-call.js"; |
| 3 | +import { wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime"; |
5 | 4 | import { |
6 | 5 | initializeGlobalHookRunner, |
7 | 6 | resetGlobalHookRunner, |
8 | | -} from "../../../../src/plugins/hook-runner-global.js"; |
9 | | -import { createMockPluginRegistry } from "../../../../src/plugins/hooks.test-helpers.js"; |
10 | | -import { createEmptyPluginRegistry } from "../../../../src/plugins/registry.js"; |
11 | | -import { setActivePluginRegistry } from "../../../../src/plugins/runtime.js"; |
| 7 | +} from "openclaw/plugin-sdk/hook-runtime"; |
| 8 | +import { |
| 9 | +createEmptyPluginRegistry, |
| 10 | +createMockPluginRegistry, |
| 11 | +setActivePluginRegistry, |
| 12 | +} from "openclaw/plugin-sdk/testing"; |
| 13 | +import { afterEach, describe, expect, it, vi } from "vitest"; |
12 | 14 | import { createCodexDynamicToolBridge } from "./dynamic-tools.js"; |
13 | 15 | import type { JsonValue } from "./protocol.js"; |
14 | 16 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。