mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-16 15:43:57 -06:00
perf(test): move direct import smoke to test fixtures (#123923)
This commit is contained in:
committed by
GitHub
parent
7160c4de0b
commit
d7d059c7e6
@@ -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>
|
||||
|
||||
|
||||
@@ -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,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", () => {
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user