perf(test): move direct import smoke to test fixtures (#123923)

This commit is contained in:
Peter Steinberger
2026-08-14 19:07:48 -07:00
committed by GitHub
parent 7160c4de0b
commit d7d059c7e6
5 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -353,14 +353,14 @@ Use `isLoopbackHost(host)` when a plugin must accept only the local machine. It
| `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 |
| `plugin-sdk/channel-target-testing` | Repo-local shared target-resolution error-case suite for channel tests |
| `plugin-sdk/channel-contract-testing` | Repo-local narrow channel contract test helpers without the broad testing barrel |
| `plugin-sdk/plugin-test-contracts` | Repo-local plugin package, registration, public artifact, direct import, runtime API, and import side-effect contract helpers |
| `plugin-sdk/plugin-test-contracts` | Repo-local plugin package, registration, public artifact, runtime API, and import side-effect contract helpers |
| `plugin-sdk/plugin-state-test-runtime` | Repo-local plugin state store, ingress queue, and state DB test helpers |
| `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 |
| `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` |
| `plugin-sdk/reply-payload-testing` | Repo-local helpers for attaching metadata to reply payload fixtures |
| `plugin-sdk/sqlite-runtime-testing` | Repo-local SQLite lifecycle helpers for first-party tests |
| `plugin-sdk/test-state` | Repo-local isolated OpenClaw state, config, workspace, environment, and auth-profile fixtures for plugin tests |
| `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 |
| `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 |
| `plugin-sdk/test-node-mocks` | Repo-local focused Node builtin mock helpers for use inside Vitest `vi.mock("node:*")` factories |
</Accordion>
+2
View File
@@ -44,6 +44,7 @@ import { createRequestCaptureJsonFetch } from "openclaw/plugin-sdk/test-media-un
import {
bundledPluginRoot,
createCliRuntimeCapture,
runDirectImportSmoke,
typedCases,
} from "openclaw/plugin-sdk/test-fixtures";
import { mockNodeBuiltinModule } from "openclaw/plugin-sdk/test-node-mocks";
@@ -118,6 +119,7 @@ the focused test subpaths above.
| `createProviderUsageFetch` | Build provider usage fetch fixtures. Import from `plugin-sdk/test-env` |
| `useFrozenTime` / `useRealTime` | Freeze and restore timers for time-sensitive tests. Import from `plugin-sdk/test-env` |
| `createCliRuntimeCapture` | Capture CLI runtime output in tests. Import from `plugin-sdk/test-fixtures` |
| `runDirectImportSmoke` | Run a plugin public-surface import in an isolated Node process. Import from `plugin-sdk/test-fixtures` |
| `importFreshModule` | Import an ESM module with a fresh query token to bypass module cache. Import from `plugin-sdk/test-fixtures` |
| `bundledPluginRoot` / `bundledPluginFile` | Resolve bundled plugin source or dist fixture paths. Import from `plugin-sdk/test-fixtures` |
| `mockNodeBuiltinModule` | Install narrow Node builtin Vitest mocks. Import from `plugin-sdk/test-node-mocks` |
+1 -1
View File
@@ -1,5 +1,5 @@
// Irc tests cover runtime api plugin behavior.
import { runDirectImportSmoke } from "openclaw/plugin-sdk/plugin-test-contracts";
import { runDirectImportSmoke } from "openclaw/plugin-sdk/test-fixtures";
import { beforeAll, describe, expect, it } from "vitest";
describe("irc bundled api seams", () => {
-1
View File
@@ -15,7 +15,6 @@ export {
registerVirtualTestPlugin,
requireProvider,
} from "./test-helpers/contracts-testkit.js";
export { runDirectImportSmoke } from "./test-helpers/direct-smoke.js";
export { describePackageManifestContract } from "./test-helpers/package-manifest-contract.js";
export { pluginRegistrationContractCases } from "./test-helpers/plugin-registration-contract-cases.js";
+1
View File
@@ -51,6 +51,7 @@ export {
repoInstallSpec,
} from "./test-helpers/bundled-plugin-paths.js";
export { importFreshModule } from "./test-helpers/import-fresh.js";
export { runDirectImportSmoke } from "./test-helpers/direct-smoke.js";
export {
createGrayscaleAlphaPngBuffer,
createNoisyPngBuffer,