Repository navigation
test: make suites safe without isolation - #78834
Conversation
eed0555 to
6e53c91
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eed0555383
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory { | ||
| const override = ( | ||
| globalThis as typeof globalThis & { | ||
| [JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory; | ||
| } | ||
| )[JITI_FACTORY_OVERRIDE_KEY]; | ||
| if (override) { | ||
| return override; | ||
| } | ||
| if (createJitiLoaderFactory) { | ||
| return createJitiLoaderFactory; | ||
| } |
There was a problem hiding this comment.
Restore Jiti factory override support
Removing the global openclaw.pluginModuleLoaderJitiFactoryOverride check from loadCreateJitiLoaderFactory breaks existing tests that still inject a fake loader via that symbol (for example src/channels/plugins/module-loader.test.ts and src/plugin-sdk/channel-entry-contract.test.ts). In that setup, getCachedPluginModuleLoader now always uses the real jiti loader, so the TypeScript fallback test executes the fixture module and fails with Error: native source load failed when running the channels suite (pnpm test src/channels/plugins/module-loader.test.ts -- --isolate=false).
Useful? React with 👍 / 👎.
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: test: make suites safe without isolation This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
719f905 to
d40859d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d40859d69c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory { | ||
| const override = ( | ||
| globalThis as typeof globalThis & { | ||
| [JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory; | ||
| } | ||
| )[JITI_FACTORY_OVERRIDE_KEY]; | ||
| if (override) { | ||
| return override; | ||
| } | ||
| if (createJitiLoaderFactory) { | ||
| return createJitiLoaderFactory; | ||
| } |
There was a problem hiding this comment.
Restore Jiti loader override used by channel loader tests
loadCreateJitiLoaderFactory now always pulls createJiti from require("jiti"), but several suites still inject a fake loader through Symbol.for("openclaw.pluginModuleLoaderJitiFactoryOverride") (for example src/channels/plugins/module-loader.test.ts and src/plugin-sdk/channel-entry-contract.test.ts). With this hook removed, those tests hit the real Jiti path and execute the fixture source module instead of the stubbed loader, which reintroduces deterministic failures in the TypeScript fallback scenario (native source load failed) when running the affected suites with --isolate=false.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9407bda32f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function loadCreateJitiLoaderFactory(): PluginModuleLoaderFactory { | ||
| const override = ( | ||
| globalThis as typeof globalThis & { | ||
| [JITI_FACTORY_OVERRIDE_KEY]?: PluginModuleLoaderFactory; | ||
| } | ||
| )[JITI_FACTORY_OVERRIDE_KEY]; | ||
| if (override) { | ||
| return override; | ||
| } | ||
| if (createJitiLoaderFactory) { | ||
| return createJitiLoaderFactory; | ||
| } |
There was a problem hiding this comment.
Restore Jiti factory override hook in loader cache
Removing the globalThis[Symbol.for("openclaw.pluginModuleLoaderJitiFactoryOverride")] check means suites that still stub that symbol can no longer inject a fake loader and will execute real source modules via jiti, which breaks the non-isolated channel-entry contract coverage path when it expects stubbed loading behavior. Fresh evidence in this commit: src/channels/plugins/module-loader.test.ts was migrated to a new per-module setter, but src/plugin-sdk/channel-entry-contract.test.ts still sets the symbol-based override (e.g. lines 289 and 419), so the remaining suite now loses its injection seam.
Useful? React with 👍 / 👎.
|
Landed.
|
* test: make suites safe without isolation * fix: narrow auth profile credential types * test: inject channel module loader factory locally
* test: make suites safe without isolation * fix: narrow auth profile credential types * test: inject channel module loader factory locally
* test: make suites safe without isolation * fix: narrow auth profile credential types * test: inject channel module loader factory locally
Summary
Verification
rg -n "isolate:\s*true" test src extensions packages ui-> no matches/tmp/openclaw-tests.mdaudit tracker: 0 unchecked entries; 5,183 current*.test.tscovered, plus one stale test file removedgit diff --checkgit diff --name-only --diff-filter=ACM | xargs pnpm exec oxfmt --check --threads=1pnpm test extensions/telegram -- --isolate=false --reporter=verbose-> 108 files / 1,490 tests passedpnpm test extensions/thread-ownership extensions/tlon extensions/together extensions/tokenjuice extensions/tts-local-cli extensions/twitch extensions/venice extensions/vercel-ai-gateway extensions/video-generation-core extensions/vllm extensions/voice-call extensions/volcengine extensions/vydra -- --isolate=false --reporter=verbose-> 6 shards passedpnpm test extensions/video-generation-providers.live.test.ts extensions/web-readability extensions/webhooks extensions/whatsapp extensions/xai extensions/xiaomi extensions/zai extensions/zalo extensions/zalouser -- --isolate=false --reporter=verbose-> 6 shards passedpnpm test extensions/acpx extensions/active-memory extensions/alibaba extensions/amazon-bedrock-mantle extensions/amazon-bedrock extensions/anthropic-vertex extensions/anthropic extensions/arcee extensions/azure-speech extensions/bluebubbles extensions/bonjour extensions/brave extensions/browser -- --isolate=false --reporter=verbose-> 7 shards passedpnpm test extensions/byteplus extensions/chutes extensions/cloudflare-ai-gateway extensions/codex extensions/comfy extensions/deepgram extensions/deepinfra extensions/deepseek extensions/device-pair extensions/diagnostics-otel extensions/diagnostics-prometheus extensions/diffs extensions/discord extensions/document-extract extensions/duckduckgo extensions/elevenlabs extensions/exa extensions/fal extensions/feishu extensions/file-transfer extensions/firecrawl extensions/fireworks extensions/github-copilot extensions/google-meet extensions/google extensions/googlechat extensions/gradium extensions/groq extensions/huggingface extensions/image-generation-core extensions/imessage extensions/inworld extensions/irc extensions/kilocode extensions/kimi-coding extensions/line extensions/litellm extensions/llm-task extensions/lmstudio extensions/lobster -- --isolate=false --reporter=verbose-> 11 shards passedpnpm --dir ui test -- --reporter=verbose-> 112 files / 1,255 tests passedpnpm --dir ui exec vitest run --config vitest.node.config.ts --reporter=verbose-> 23 files / 323 tests passedReal behavior proof
isolate: falsein the plugin, gateway-server, and UI configs, ran the non-isolated suite buckets listed above on Crabbox/Testbox; after rebasing onto latestmain, ranpnpm test extensions/amazon-bedrock/index.test.ts extensions/google/video-generation-provider.test.ts -- --isolate=false --reporter=verboselocally.108 files / 1,490 tests passed; UI browser config112 files / 1,255 tests passed; UI node config23 files / 323 tests passed; plugin config144 files / 1,804 tests passed; gateway-server config101 files / 902 tests passed; extension buckets completed across 6, 6, 7, and 11 Vitest shards without isolation.isolate: trueconfig override and no unchecked files in/tmp/openclaw-tests.md; the local rebase validation passed2 files / 44 tests.