Skip to content

Commit d7d059c

Browse files
authored
perf(test): move direct import smoke to test fixtures (#123923)
1 parent 7160c4d commit d7d059c

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎docs/plugins/sdk-subpaths.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ Use `isLoopbackHost(host)` when a plugin must accept only the local machine. It
353353
| `plugin-sdk/channel-test-helpers` | Repo-local channel-oriented test helpers for generic actions/setup/status contracts, directory assertions, account startup lifecycle, send-config threading, runtime mocks, status issues, outbound delivery, and hook registration |
354354
| `plugin-sdk/channel-target-testing` | Repo-local shared target-resolution error-case suite for channel tests |
355355
| `plugin-sdk/channel-contract-testing` | Repo-local narrow channel contract test helpers without the broad testing barrel |
356-
| `plugin-sdk/plugin-test-contracts` | Repo-local plugin package, registration, public artifact, direct import, runtime API, and import side-effect contract helpers |
356+
| `plugin-sdk/plugin-test-contracts` | Repo-local plugin package, registration, public artifact, runtime API, and import side-effect contract helpers |
357357
| `plugin-sdk/plugin-state-test-runtime` | Repo-local plugin state store, ingress queue, and state DB test helpers |
358358
| `plugin-sdk/provider-test-contracts` | Repo-local provider runtime, auth, discovery, onboard, catalog, wizard, media capability, replay policy, realtime STT live-audio, web-search/fetch, and stream contract helpers |
359359
| `plugin-sdk/provider-http-test-mocks` | Private-local after July 2026; Repo-local opt-in Vitest HTTP/auth mocks for provider tests that exercise `plugin-sdk/provider-http` |
360360
| `plugin-sdk/reply-payload-testing` | Repo-local helpers for attaching metadata to reply payload fixtures |
361361
| `plugin-sdk/sqlite-runtime-testing` | Repo-local SQLite lifecycle helpers for first-party tests |
362362
| `plugin-sdk/test-state` | Repo-local isolated OpenClaw state, config, workspace, environment, and auth-profile fixtures for plugin tests |
363-
| `plugin-sdk/test-fixtures` | Repo-local generic CLI runtime capture, sandbox context, skill writer, agent-message, system-event, module reload, bundled plugin path, terminal-text, chunking, auth-token, and typed-case fixtures |
363+
| `plugin-sdk/test-fixtures` | Repo-local generic CLI runtime capture, direct-import smoke, sandbox context, skill writer, agent-message, system-event, module reload, bundled plugin path, terminal-text, chunking, auth-token, and typed-case fixtures |
364364
| `plugin-sdk/test-node-mocks` | Repo-local focused Node builtin mock helpers for use inside Vitest `vi.mock("node:*")` factories |
365365
</Accordion>
366366

‎docs/plugins/sdk-testing.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { createRequestCaptureJsonFetch } from "openclaw/plugin-sdk/test-media-un
4444
import {
4545
bundledPluginRoot,
4646
createCliRuntimeCapture,
47+
runDirectImportSmoke,
4748
typedCases,
4849
} from "openclaw/plugin-sdk/test-fixtures";
4950
import { mockNodeBuiltinModule } from "openclaw/plugin-sdk/test-node-mocks";
@@ -118,6 +119,7 @@ the focused test subpaths above.
118119
| `createProviderUsageFetch` | Build provider usage fetch fixtures. Import from `plugin-sdk/test-env` |
119120
| `useFrozenTime` / `useRealTime` | Freeze and restore timers for time-sensitive tests. Import from `plugin-sdk/test-env` |
120121
| `createCliRuntimeCapture` | Capture CLI runtime output in tests. Import from `plugin-sdk/test-fixtures` |
122+
| `runDirectImportSmoke` | Run a plugin public-surface import in an isolated Node process. Import from `plugin-sdk/test-fixtures` |
121123
| `importFreshModule` | Import an ESM module with a fresh query token to bypass module cache. Import from `plugin-sdk/test-fixtures` |
122124
| `bundledPluginRoot` / `bundledPluginFile` | Resolve bundled plugin source or dist fixture paths. Import from `plugin-sdk/test-fixtures` |
123125
| `mockNodeBuiltinModule` | Install narrow Node builtin Vitest mocks. Import from `plugin-sdk/test-node-mocks` |

‎extensions/irc/runtime-api.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Irc tests cover runtime api plugin behavior.
2-
import { runDirectImportSmoke } from "openclaw/plugin-sdk/plugin-test-contracts";
2+
import { runDirectImportSmoke } from "openclaw/plugin-sdk/test-fixtures";
33
import { beforeAll, describe, expect, it } from "vitest";
44

55
describe("irc bundled api seams", () => {

‎src/plugin-sdk/plugin-test-contracts.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export {
1515
registerVirtualTestPlugin,
1616
requireProvider,
1717
} from "./test-helpers/contracts-testkit.js";
18-
export { runDirectImportSmoke } from "./test-helpers/direct-smoke.js";
1918
export { describePackageManifestContract } from "./test-helpers/package-manifest-contract.js";
2019
export { pluginRegistrationContractCases } from "./test-helpers/plugin-registration-contract-cases.js";
2120

‎src/plugin-sdk/test-fixtures.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export {
5151
repoInstallSpec,
5252
} from "./test-helpers/bundled-plugin-paths.js";
5353
export { importFreshModule } from "./test-helpers/import-fresh.js";
54+
export { runDirectImportSmoke } from "./test-helpers/direct-smoke.js";
5455
export {
5556
createGrayscaleAlphaPngBuffer,
5657
createNoisyPngBuffer,

0 commit comments

Comments
 (0)