Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
11
test/vitest/discord-api-types-payloads-v10-runtime.ts
Normal file
11
test/vitest/discord-api-types-payloads-v10-runtime.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// Discord payload types runtime helper loads discord-api-types payloads at runtime.
|
||||
import { createRequire } from "node:module";
|
||||
import type * as DiscordPayloadApiTypes from "discord-api-types/payloads/v10";
|
||||
|
||||
const requireDiscordPayloadApiTypes = createRequire(import.meta.url);
|
||||
const discordPayloadApiTypes = requireDiscordPayloadApiTypes(
|
||||
"discord-api-types/payloads/v10",
|
||||
) as typeof DiscordPayloadApiTypes;
|
||||
|
||||
export default discordPayloadApiTypes;
|
||||
export const { PollLayoutType } = discordPayloadApiTypes;
|
||||
30
test/vitest/discord-api-types-v10-runtime.ts
Normal file
30
test/vitest/discord-api-types-v10-runtime.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// Discord API types runtime helper loads discord-api-types v10 at runtime.
|
||||
import { createRequire } from "node:module";
|
||||
import type * as DiscordApiTypes from "discord-api-types/v10";
|
||||
|
||||
const requireDiscordApiTypes = createRequire(import.meta.url);
|
||||
const discordApiTypes = requireDiscordApiTypes("discord-api-types/v10") as typeof DiscordApiTypes;
|
||||
|
||||
export default discordApiTypes;
|
||||
export const {
|
||||
ApplicationCommandOptionType,
|
||||
ApplicationCommandType,
|
||||
ButtonStyle,
|
||||
ChannelType,
|
||||
ComponentType,
|
||||
GatewayCloseCodes,
|
||||
GatewayDispatchEvents,
|
||||
GatewayIntentBits,
|
||||
GatewayOpcodes,
|
||||
InteractionContextType,
|
||||
InteractionResponseType,
|
||||
InteractionType,
|
||||
MessageFlags,
|
||||
MessageReferenceType,
|
||||
MessageType,
|
||||
PermissionFlagsBits,
|
||||
PresenceUpdateStatus,
|
||||
Routes,
|
||||
StickerFormatType,
|
||||
TextInputStyle,
|
||||
} = discordApiTypes;
|
||||
12
test/vitest/vitest.acp.config.ts
Normal file
12
test/vitest/vitest.acp.config.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// Vitest acp config wires the acp test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAcpVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/acp/**/*.test.ts"], {
|
||||
dir: "src/acp",
|
||||
env,
|
||||
name: "acp",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAcpVitestConfig();
|
||||
14
test/vitest/vitest.agents-core.config.ts
Normal file
14
test/vitest/vitest.agents-core.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest agents core config wires the agents core test shard.
|
||||
import { agentsCoreTestPatterns } from "./vitest.agents-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAgentsCoreVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(agentsCoreTestPatterns, {
|
||||
dir: "src/agents",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "agents-core",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAgentsCoreVitestConfig();
|
||||
13
test/vitest/vitest.agents-embedded-agent.config.ts
Normal file
13
test/vitest/vitest.agents-embedded-agent.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Vitest agents embedded agent config wires the agents embedded agent test shard.
|
||||
import { agentsEmbeddedTestPatterns } from "./vitest.agents-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAgentsEmbeddedVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(agentsEmbeddedTestPatterns, {
|
||||
dir: "src/agents",
|
||||
env,
|
||||
name: "agents-embedded-agent",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAgentsEmbeddedVitestConfig();
|
||||
15
test/vitest/vitest.agents-paths.mjs
Normal file
15
test/vitest/vitest.agents-paths.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
// Test routing globs for agent core, embedded-agent, tool, and support suites.
|
||||
export const agentsAllTestPatterns = ["src/agents/**/*.test.ts"];
|
||||
|
||||
export const agentsCoreTestPatterns = ["src/agents/*.test.ts"];
|
||||
|
||||
export const agentsEmbeddedTestPatterns = ["src/agents/embedded-agent-runner/**/*.test.ts"];
|
||||
|
||||
export const agentsToolsTestPatterns = ["src/agents/tools/**/*.test.ts"];
|
||||
|
||||
export const agentsSupportTestPatterns = ["src/agents/*/**/*.test.ts"];
|
||||
|
||||
export const agentsSupportExcludePatterns = [
|
||||
"src/agents/embedded-agent-runner/**",
|
||||
"src/agents/tools/**",
|
||||
];
|
||||
14
test/vitest/vitest.agents-support.config.ts
Normal file
14
test/vitest/vitest.agents-support.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest agents support config wires the agents support test shard.
|
||||
import { agentsSupportExcludePatterns, agentsSupportTestPatterns } from "./vitest.agents-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAgentsSupportVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(agentsSupportTestPatterns, {
|
||||
dir: "src/agents",
|
||||
env,
|
||||
exclude: agentsSupportExcludePatterns,
|
||||
name: "agents-support",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAgentsSupportVitestConfig();
|
||||
14
test/vitest/vitest.agents-tools.config.ts
Normal file
14
test/vitest/vitest.agents-tools.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest agents tools config wires the agents tools test shard.
|
||||
import { agentsToolsTestPatterns } from "./vitest.agents-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAgentsToolsVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(agentsToolsTestPatterns, {
|
||||
dir: "src/agents",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "agents-tools",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAgentsToolsVitestConfig();
|
||||
13
test/vitest/vitest.agents.config.ts
Normal file
13
test/vitest/vitest.agents.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Vitest agents config wires the agents test shard.
|
||||
import { agentsAllTestPatterns } from "./vitest.agents-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAgentsVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(agentsAllTestPatterns, {
|
||||
dir: "src/agents",
|
||||
env,
|
||||
name: "agents",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAgentsVitestConfig();
|
||||
14
test/vitest/vitest.auto-reply-core.config.ts
Normal file
14
test/vitest/vitest.auto-reply-core.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest auto reply core config wires the auto reply core test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
import { autoReplyCoreTestExclude, autoReplyCoreTestInclude } from "./vitest.test-shards.mjs";
|
||||
|
||||
export function createAutoReplyCoreVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig([...autoReplyCoreTestInclude], {
|
||||
dir: "src/auto-reply",
|
||||
env,
|
||||
exclude: [...autoReplyCoreTestExclude],
|
||||
name: "auto-reply-core",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAutoReplyCoreVitestConfig();
|
||||
16
test/vitest/vitest.auto-reply-reply.config.ts
Normal file
16
test/vitest/vitest.auto-reply-reply.config.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Vitest auto reply reply config wires the auto reply reply test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
import { autoReplyReplySubtreeTestInclude } from "./vitest.test-shards.mjs";
|
||||
|
||||
export function createAutoReplyReplyVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig([...autoReplyReplySubtreeTestInclude], {
|
||||
dir: "src/auto-reply",
|
||||
env,
|
||||
name: "auto-reply-reply",
|
||||
sequence: {
|
||||
groupOrder: 1,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default createAutoReplyReplyVitestConfig();
|
||||
13
test/vitest/vitest.auto-reply-top-level.config.ts
Normal file
13
test/vitest/vitest.auto-reply-top-level.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Vitest auto reply top level config wires the auto reply top level test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
import { autoReplyTopLevelReplyTestInclude } from "./vitest.test-shards.mjs";
|
||||
|
||||
export function createAutoReplyTopLevelVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig([...autoReplyTopLevelReplyTestInclude], {
|
||||
dir: "src/auto-reply",
|
||||
env,
|
||||
name: "auto-reply-top-level",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAutoReplyTopLevelVitestConfig();
|
||||
12
test/vitest/vitest.auto-reply.config.ts
Normal file
12
test/vitest/vitest.auto-reply.config.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// Vitest auto reply config wires the auto reply test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createAutoReplyVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/auto-reply/**/*.test.ts"], {
|
||||
dir: "src/auto-reply",
|
||||
env,
|
||||
name: "auto-reply",
|
||||
});
|
||||
}
|
||||
|
||||
export default createAutoReplyVitestConfig();
|
||||
36
test/vitest/vitest.boundary.config.ts
Normal file
36
test/vitest/vitest.boundary.config.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// Vitest boundary config wires the boundary test shard.
|
||||
import { defineProject } from "vitest/config";
|
||||
import { loadPatternListFromEnv, narrowIncludePatternsForCli } from "./vitest.pattern-file.ts";
|
||||
import { resolveVitestIsolation } from "./vitest.scoped-config.ts";
|
||||
import { nonIsolatedRunnerPath, sharedVitestConfig } from "./vitest.shared.config.ts";
|
||||
import { boundaryTestFiles } from "./vitest.unit-paths.mjs";
|
||||
|
||||
export function loadBoundaryIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createBoundaryVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
argv: string[] = process.argv,
|
||||
) {
|
||||
const cliIncludePatterns = narrowIncludePatternsForCli(boundaryTestFiles, argv);
|
||||
const isolate = resolveVitestIsolation(env);
|
||||
return defineProject({
|
||||
...sharedVitestConfig,
|
||||
test: {
|
||||
...sharedVitestConfig.test,
|
||||
name: "boundary",
|
||||
isolate,
|
||||
...(isolate ? { runner: undefined } : { runner: nonIsolatedRunnerPath }),
|
||||
include: loadBoundaryIncludePatternsFromEnv(env) ?? cliIncludePatterns ?? boundaryTestFiles,
|
||||
...(cliIncludePatterns?.length === 0 ? { passWithNoTests: true } : {}),
|
||||
// Boundary workers still need the shared isolated HOME/bootstrap. Only
|
||||
// per-file module isolation is disabled here.
|
||||
setupFiles: sharedVitestConfig.test.setupFiles,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default createBoundaryVitestConfig();
|
||||
6
test/vitest/vitest.bundled-plugin-paths.ts
Normal file
6
test/vitest/vitest.bundled-plugin-paths.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Vitest bundled plugin paths helper lists test file patterns for the bundled plugin paths shard.
|
||||
export const BUNDLED_PLUGIN_ROOT_DIR = "extensions";
|
||||
export const BUNDLED_PLUGIN_PATH_PREFIX = `${BUNDLED_PLUGIN_ROOT_DIR}/`;
|
||||
export const BUNDLED_PLUGIN_TEST_GLOB = `${BUNDLED_PLUGIN_ROOT_DIR}/**/*.test.ts`;
|
||||
export const BUNDLED_PLUGIN_E2E_TEST_GLOB = `${BUNDLED_PLUGIN_ROOT_DIR}/**/*.e2e.test.ts`;
|
||||
export const BUNDLED_PLUGIN_LIVE_TEST_GLOB = `${BUNDLED_PLUGIN_ROOT_DIR}/**/*.live.test.ts`;
|
||||
37
test/vitest/vitest.bundled.config.ts
Normal file
37
test/vitest/vitest.bundled.config.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// Vitest bundled config wires the bundled test shard.
|
||||
import path from "node:path";
|
||||
import {
|
||||
bundledPluginDependentUnitTestFiles,
|
||||
unitTestAdditionalExcludePatterns,
|
||||
} from "./vitest.unit-paths.mjs";
|
||||
import { createUnitVitestConfigWithOptions } from "./vitest.unit.config.ts";
|
||||
|
||||
function normalizeGlobCandidate(value: string): string {
|
||||
return value.split(path.sep).join("/");
|
||||
}
|
||||
|
||||
function excludePatternCouldMatchFile(pattern: string, file: string): boolean {
|
||||
const normalizedPattern = normalizeGlobCandidate(pattern);
|
||||
const normalizedFile = normalizeGlobCandidate(file);
|
||||
if (normalizedPattern === normalizedFile) {
|
||||
return true;
|
||||
}
|
||||
if (normalizedPattern.endsWith("/**")) {
|
||||
const prefix = normalizedPattern.slice(0, -3);
|
||||
return normalizedFile === prefix || normalizedFile.startsWith(`${prefix}/`);
|
||||
}
|
||||
return path.matchesGlob(normalizedFile, normalizedPattern);
|
||||
}
|
||||
|
||||
const bundledUnitExcludePatterns = unitTestAdditionalExcludePatterns.filter(
|
||||
(pattern) =>
|
||||
!bundledPluginDependentUnitTestFiles.some((file) =>
|
||||
excludePatternCouldMatchFile(pattern, file),
|
||||
),
|
||||
);
|
||||
|
||||
export default createUnitVitestConfigWithOptions(process.env, {
|
||||
includePatterns: bundledPluginDependentUnitTestFiles,
|
||||
extraExcludePatterns: bundledUnitExcludePatterns,
|
||||
name: "bundled",
|
||||
});
|
||||
68
test/vitest/vitest.channel-paths.mjs
Normal file
68
test/vitest/vitest.channel-paths.mjs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Test routing roots and globs for core channel tests and channel plugin tests.
|
||||
import path from "node:path";
|
||||
import { BUNDLED_PLUGIN_PATH_PREFIX } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
import { splitChannelExtensionTestRoots } from "./vitest.extension-channel-split-paths.mjs";
|
||||
|
||||
const normalizeRepoPath = (value) => value.split(path.sep).join("/");
|
||||
|
||||
export const extensionRoutedChannelTestFiles = [];
|
||||
|
||||
const extensionRoutedChannelTestFileSet = new Set(extensionRoutedChannelTestFiles);
|
||||
|
||||
export const channelTestRoots = ["src/channels", ...splitChannelExtensionTestRoots];
|
||||
|
||||
const splitChannelExtensionTestRootSet = new Set(splitChannelExtensionTestRoots);
|
||||
|
||||
export const extensionChannelTestRoots = channelTestRoots.filter(
|
||||
(root) =>
|
||||
root.startsWith(BUNDLED_PLUGIN_PATH_PREFIX) && !splitChannelExtensionTestRootSet.has(root),
|
||||
);
|
||||
export const coreChannelTestRoots = channelTestRoots.filter(
|
||||
(root) => !root.startsWith(BUNDLED_PLUGIN_PATH_PREFIX),
|
||||
);
|
||||
export const channelTestPrefixes = channelTestRoots.map((root) => `${root}/`);
|
||||
export const extensionChannelTestInclude = extensionChannelTestRoots.map(
|
||||
(root) => `${root}/**/*.test.ts`,
|
||||
);
|
||||
export const coreChannelTestInclude = coreChannelTestRoots.map((root) => `${root}/**/*.test.ts`);
|
||||
|
||||
const extensionChannelRootOverrideBasenames = new Map();
|
||||
for (const file of extensionRoutedChannelTestFiles) {
|
||||
if (!file.startsWith(BUNDLED_PLUGIN_PATH_PREFIX)) {
|
||||
continue;
|
||||
}
|
||||
const relativeFile = file.slice(BUNDLED_PLUGIN_PATH_PREFIX.length);
|
||||
const separator = relativeFile.indexOf("/");
|
||||
if (separator === -1) {
|
||||
continue;
|
||||
}
|
||||
const root = relativeFile.slice(0, separator);
|
||||
const baseName = path.basename(relativeFile, ".test.ts");
|
||||
const current = extensionChannelRootOverrideBasenames.get(root) ?? [];
|
||||
current.push(baseName);
|
||||
extensionChannelRootOverrideBasenames.set(root, current);
|
||||
}
|
||||
|
||||
export const extensionExcludedChannelTestGlobs = channelTestRoots
|
||||
.filter((root) => root.startsWith(BUNDLED_PLUGIN_PATH_PREFIX))
|
||||
.map((root) => root.slice(BUNDLED_PLUGIN_PATH_PREFIX.length))
|
||||
.map((relativeRoot) => {
|
||||
const allowedBasenames = extensionChannelRootOverrideBasenames.get(relativeRoot) ?? [];
|
||||
if (allowedBasenames.length === 0) {
|
||||
return `${relativeRoot}/**`;
|
||||
}
|
||||
const alternation = allowedBasenames.join("|");
|
||||
return `${relativeRoot}/**/!(${alternation}).test.ts`;
|
||||
});
|
||||
|
||||
export const extensionChannelOverrideExcludeGlobs = extensionRoutedChannelTestFiles
|
||||
.filter((file) => file.startsWith(BUNDLED_PLUGIN_PATH_PREFIX))
|
||||
.map((file) => file.slice(BUNDLED_PLUGIN_PATH_PREFIX.length));
|
||||
|
||||
export function isChannelSurfaceTestFile(filePath) {
|
||||
const normalizedFile = normalizeRepoPath(filePath);
|
||||
return (
|
||||
channelTestPrefixes.some((prefix) => normalizedFile.startsWith(prefix)) &&
|
||||
!extensionRoutedChannelTestFileSet.has(normalizedFile)
|
||||
);
|
||||
}
|
||||
21
test/vitest/vitest.channels.config.ts
Normal file
21
test/vitest/vitest.channels.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// Vitest channels config wires the channels test shard.
|
||||
import { coreChannelTestInclude } from "./vitest.channel-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createChannelsVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(loadIncludePatternsFromEnv(env) ?? coreChannelTestInclude, {
|
||||
env,
|
||||
exclude: ["src/gateway/**", "src/channels/plugins/contracts/**"],
|
||||
name: "channels",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default createChannelsVitestConfig();
|
||||
13
test/vitest/vitest.cli.config.ts
Normal file
13
test/vitest/vitest.cli.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Vitest cli config wires the cli test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createCliVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/cli/**/*.test.ts"], {
|
||||
dir: "src/cli",
|
||||
env,
|
||||
name: "cli",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default createCliVitestConfig();
|
||||
105
test/vitest/vitest.commands-light-paths.mjs
Normal file
105
test/vitest/vitest.commands-light-paths.mjs
Normal file
@@ -0,0 +1,105 @@
|
||||
// Test routing map for lightweight command tests and their source triggers.
|
||||
const normalizeRepoPath = (value) => value.replaceAll("\\", "/");
|
||||
|
||||
const commandsLightEntries = [
|
||||
{ source: "src/commands/cleanup-utils.ts", test: "src/commands/cleanup-utils.test.ts" },
|
||||
{ test: "src/commands/auth-choice.test.ts" },
|
||||
{
|
||||
source: "src/commands/dashboard.links.ts",
|
||||
test: "src/commands/dashboard.links.test.ts",
|
||||
},
|
||||
{ test: "src/commands/daemon-install-helpers.test.ts" },
|
||||
{ source: "src/commands/doctor-browser.ts", test: "src/commands/doctor-browser.test.ts" },
|
||||
{
|
||||
source: "src/commands/doctor-gateway-auth-token.ts",
|
||||
test: "src/commands/doctor-gateway-auth-token.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/channel-plugin-blockers.ts",
|
||||
test: "src/commands/doctor/shared/channel-plugin-blockers.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/missing-configured-plugin-install.ts",
|
||||
test: "src/commands/doctor/shared/missing-configured-plugin-install.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/preview-warnings.ts",
|
||||
test: "src/commands/doctor/shared/preview-warnings.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/release-configured-plugin-installs.ts",
|
||||
test: "src/commands/doctor/shared/release-configured-plugin-installs.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/stale-plugin-config.ts",
|
||||
test: "src/commands/doctor/shared/stale-plugin-config.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/doctor/shared/stale-oauth-profile-shadows.ts",
|
||||
test: "src/commands/doctor/shared/stale-oauth-profile-shadows.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/gateway-status/helpers.ts",
|
||||
test: "src/commands/gateway-status/helpers.test.ts",
|
||||
},
|
||||
{ test: "src/commands/models/auth.test.ts" },
|
||||
{ test: "src/commands/models/list.auth-index.test.ts" },
|
||||
{ test: "src/commands/models/list.list-command.forward-compat.test.ts" },
|
||||
{
|
||||
source: "src/commands/models/list.status-command.ts",
|
||||
test: "src/commands/models/list.status.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/sandbox-formatters.ts",
|
||||
test: "src/commands/sandbox-formatters.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-json-command.ts",
|
||||
test: "src/commands/status-json-command.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-json-payload.ts",
|
||||
test: "src/commands/status-json-payload.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-json-runtime.ts",
|
||||
test: "src/commands/status-json-runtime.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-overview-rows.ts",
|
||||
test: "src/commands/status-overview-rows.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-overview-surface.ts",
|
||||
test: "src/commands/status-overview-surface.test.ts",
|
||||
},
|
||||
{
|
||||
source: "src/commands/status-overview-values.ts",
|
||||
test: "src/commands/status-overview-values.test.ts",
|
||||
},
|
||||
{ source: "src/commands/text-format.ts", test: "src/commands/text-format.test.ts" },
|
||||
];
|
||||
|
||||
const commandsLightIncludePatternByFile = new Map(
|
||||
commandsLightEntries.flatMap(({ source, test }) =>
|
||||
source
|
||||
? [
|
||||
[source, test],
|
||||
[test, test],
|
||||
]
|
||||
: [[test, test]],
|
||||
),
|
||||
);
|
||||
|
||||
export const commandsLightSourceFiles = commandsLightEntries.flatMap(({ source }) =>
|
||||
source ? [source] : [],
|
||||
);
|
||||
export const commandsLightTestFiles = commandsLightEntries.map(({ test }) => test);
|
||||
|
||||
export function isCommandsLightTarget(file) {
|
||||
return commandsLightIncludePatternByFile.has(normalizeRepoPath(file));
|
||||
}
|
||||
|
||||
export function resolveCommandsLightIncludePattern(file) {
|
||||
return commandsLightIncludePatternByFile.get(normalizeRepoPath(file)) ?? null;
|
||||
}
|
||||
17
test/vitest/vitest.commands-light.config.ts
Normal file
17
test/vitest/vitest.commands-light.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// Vitest commands light config wires the commands light test shard.
|
||||
import { commandsLightTestFiles } from "./vitest.commands-light-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
import { getUnitFastTestFiles } from "./vitest.unit-fast-paths.mjs";
|
||||
|
||||
export function createCommandsLightVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(commandsLightTestFiles, {
|
||||
dir: "src/commands",
|
||||
env,
|
||||
exclude: getUnitFastTestFiles(),
|
||||
includeOpenClawRuntimeSetup: false,
|
||||
name: "commands-light",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default createCommandsLightVitestConfig();
|
||||
16
test/vitest/vitest.commands.config.ts
Normal file
16
test/vitest/vitest.commands.config.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Vitest commands config wires the commands test shard.
|
||||
import { commandsLightTestFiles } from "./vitest.commands-light-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createCommandsVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/commands/**/*.test.ts"], {
|
||||
dir: "src/commands",
|
||||
env,
|
||||
exclude: commandsLightTestFiles,
|
||||
fileParallelism: false,
|
||||
name: "commands",
|
||||
pool: "forks",
|
||||
});
|
||||
}
|
||||
|
||||
export default createCommandsVitestConfig();
|
||||
96
test/vitest/vitest.config.ts
Normal file
96
test/vitest/vitest.config.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
// Vitest config config wires the config test shard.
|
||||
import { defineConfig } from "vitest/config";
|
||||
import {
|
||||
resolveDefaultVitestPool,
|
||||
resolveLocalVitestMaxWorkers,
|
||||
resolveLocalVitestScheduling,
|
||||
nonIsolatedRunnerPath,
|
||||
sharedVitestConfig,
|
||||
} from "./vitest.shared.config.ts";
|
||||
|
||||
export { resolveDefaultVitestPool, resolveLocalVitestMaxWorkers, resolveLocalVitestScheduling };
|
||||
|
||||
export const rootVitestProjects = [
|
||||
"test/vitest/vitest.unit.config.ts",
|
||||
"test/vitest/vitest.infra.config.ts",
|
||||
"test/vitest/vitest.boundary.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-surface.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-config.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-registry.config.ts",
|
||||
"test/vitest/vitest.contracts-channel-session.config.ts",
|
||||
"test/vitest/vitest.contracts-plugin.config.ts",
|
||||
"test/vitest/vitest.bundled.config.ts",
|
||||
"test/vitest/vitest.gateway-core.config.ts",
|
||||
"test/vitest/vitest.gateway-client.config.ts",
|
||||
"test/vitest/vitest.gateway-methods.config.ts",
|
||||
"test/vitest/vitest.gateway-server.config.ts",
|
||||
"test/vitest/vitest.hooks.config.ts",
|
||||
"test/vitest/vitest.acp.config.ts",
|
||||
"test/vitest/vitest.runtime-config.config.ts",
|
||||
"test/vitest/vitest.secrets.config.ts",
|
||||
"test/vitest/vitest.cli.config.ts",
|
||||
"test/vitest/vitest.commands-light.config.ts",
|
||||
"test/vitest/vitest.commands.config.ts",
|
||||
"test/vitest/vitest.auto-reply.config.ts",
|
||||
"test/vitest/vitest.agents-core.config.ts",
|
||||
"test/vitest/vitest.agents-embedded-agent.config.ts",
|
||||
"test/vitest/vitest.agents-support.config.ts",
|
||||
"test/vitest/vitest.agents-tools.config.ts",
|
||||
"test/vitest/vitest.daemon.config.ts",
|
||||
"test/vitest/vitest.media.config.ts",
|
||||
"test/vitest/vitest.unit-fast.config.ts",
|
||||
"test/vitest/vitest.unit-fast-fake-timers.config.ts",
|
||||
"test/vitest/vitest.plugin-sdk-light.config.ts",
|
||||
"test/vitest/vitest.plugin-sdk.config.ts",
|
||||
"test/vitest/vitest.plugins.config.ts",
|
||||
"test/vitest/vitest.logging.config.ts",
|
||||
"test/vitest/vitest.process.config.ts",
|
||||
"test/vitest/vitest.cron.config.ts",
|
||||
"test/vitest/vitest.media-understanding.config.ts",
|
||||
"test/vitest/vitest.shared-core.config.ts",
|
||||
"test/vitest/vitest.tasks.config.ts",
|
||||
"test/vitest/vitest.tooling-docker.config.ts",
|
||||
"test/vitest/vitest.tooling-isolated.config.ts",
|
||||
"test/vitest/vitest.tooling.config.ts",
|
||||
"test/vitest/vitest.tui.config.ts",
|
||||
"test/vitest/vitest.ui.config.ts",
|
||||
"test/vitest/vitest.utils.config.ts",
|
||||
"test/vitest/vitest.wizard.config.ts",
|
||||
"test/vitest/vitest.channels.config.ts",
|
||||
"test/vitest/vitest.extension-active-memory.config.ts",
|
||||
"test/vitest/vitest.extension-acpx.config.ts",
|
||||
"test/vitest/vitest.extension-diffs.config.ts",
|
||||
"test/vitest/vitest.extension-codex.config.ts",
|
||||
"test/vitest/vitest.extension-discord.config.ts",
|
||||
"test/vitest/vitest.extension-feishu.config.ts",
|
||||
"test/vitest/vitest.extension-imessage.config.ts",
|
||||
"test/vitest/vitest.extension-irc.config.ts",
|
||||
"test/vitest/vitest.extension-line.config.ts",
|
||||
"test/vitest/vitest.extension-mattermost.config.ts",
|
||||
"test/vitest/vitest.extension-matrix.config.ts",
|
||||
"test/vitest/vitest.extension-memory.config.ts",
|
||||
"test/vitest/vitest.extension-msteams.config.ts",
|
||||
"test/vitest/vitest.extension-messaging.config.ts",
|
||||
"test/vitest/vitest.extension-provider-openai.config.ts",
|
||||
"test/vitest/vitest.extension-providers.config.ts",
|
||||
"test/vitest/vitest.extension-signal.config.ts",
|
||||
"test/vitest/vitest.extension-slack.config.ts",
|
||||
"test/vitest/vitest.extension-telegram.config.ts",
|
||||
"test/vitest/vitest.extension-voice-call.config.ts",
|
||||
"test/vitest/vitest.extension-whatsapp.config.ts",
|
||||
"test/vitest/vitest.extension-zalo.config.ts",
|
||||
"test/vitest/vitest.extension-browser.config.ts",
|
||||
"test/vitest/vitest.extension-qa.config.ts",
|
||||
"test/vitest/vitest.extension-media.config.ts",
|
||||
"test/vitest/vitest.extension-misc.config.ts",
|
||||
"test/vitest/vitest.extensions.config.ts",
|
||||
] as const;
|
||||
|
||||
export default defineConfig({
|
||||
...sharedVitestConfig,
|
||||
test: {
|
||||
...sharedVitestConfig.test,
|
||||
runner: nonIsolatedRunnerPath,
|
||||
projects: [...rootVitestProjects],
|
||||
},
|
||||
});
|
||||
14
test/vitest/vitest.contracts-channel-config.config.ts
Normal file
14
test/vitest/vitest.contracts-channel-config.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest contracts channel config config wires the contracts channel config test shard.
|
||||
import {
|
||||
channelConfigContractPatterns,
|
||||
createContractsVitestConfig,
|
||||
} from "./vitest.contracts-shared.ts";
|
||||
|
||||
export default createContractsVitestConfig(
|
||||
channelConfigContractPatterns,
|
||||
process.env,
|
||||
process.argv,
|
||||
{
|
||||
name: "contracts-channel-config",
|
||||
},
|
||||
);
|
||||
14
test/vitest/vitest.contracts-channel-registry.config.ts
Normal file
14
test/vitest/vitest.contracts-channel-registry.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest contracts channel registry config wires the contracts channel registry test shard.
|
||||
import {
|
||||
channelRegistryContractPatterns,
|
||||
createContractsVitestConfig,
|
||||
} from "./vitest.contracts-shared.ts";
|
||||
|
||||
export default createContractsVitestConfig(
|
||||
channelRegistryContractPatterns,
|
||||
process.env,
|
||||
process.argv,
|
||||
{
|
||||
name: "contracts-channel-registry",
|
||||
},
|
||||
);
|
||||
14
test/vitest/vitest.contracts-channel-session.config.ts
Normal file
14
test/vitest/vitest.contracts-channel-session.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest contracts channel session config wires the contracts channel session test shard.
|
||||
import {
|
||||
channelSessionContractPatterns,
|
||||
createContractsVitestConfig,
|
||||
} from "./vitest.contracts-shared.ts";
|
||||
|
||||
export default createContractsVitestConfig(
|
||||
channelSessionContractPatterns,
|
||||
process.env,
|
||||
process.argv,
|
||||
{
|
||||
name: "contracts-channel-session",
|
||||
},
|
||||
);
|
||||
14
test/vitest/vitest.contracts-channel-surface.config.ts
Normal file
14
test/vitest/vitest.contracts-channel-surface.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Vitest contracts channel surface config wires the contracts channel surface test shard.
|
||||
import {
|
||||
channelSurfaceContractPatterns,
|
||||
createContractsVitestConfig,
|
||||
} from "./vitest.contracts-shared.ts";
|
||||
|
||||
export default createContractsVitestConfig(
|
||||
channelSurfaceContractPatterns,
|
||||
process.env,
|
||||
process.argv,
|
||||
{
|
||||
name: "contracts-channel-surface",
|
||||
},
|
||||
);
|
||||
6
test/vitest/vitest.contracts-plugin.config.ts
Normal file
6
test/vitest/vitest.contracts-plugin.config.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Vitest contracts plugin config wires the contracts plugin test shard.
|
||||
import { createContractsVitestConfig, pluginContractPatterns } from "./vitest.contracts-shared.ts";
|
||||
|
||||
export default createContractsVitestConfig(pluginContractPatterns, process.env, process.argv, {
|
||||
name: "contracts-plugin",
|
||||
});
|
||||
93
test/vitest/vitest.contracts-shared.ts
Normal file
93
test/vitest/vitest.contracts-shared.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
// Vitest contract shared helpers build contract test project configuration.
|
||||
import path from "node:path";
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { loadPatternListFromEnv, narrowIncludePatternsForCli } from "./vitest.pattern-file.ts";
|
||||
import { nonIsolatedRunnerPath, sharedVitestConfig } from "./vitest.shared.config.ts";
|
||||
|
||||
const base = sharedVitestConfig as Record<string, unknown>;
|
||||
const baseTest = sharedVitestConfig.test ?? {};
|
||||
|
||||
export const channelSurfaceContractPatterns = [
|
||||
"src/channels/plugins/contracts/channel-catalog.contract.test.ts",
|
||||
"src/channels/plugins/contracts/channel-import-guardrails.test.ts",
|
||||
"src/channels/plugins/contracts/group-policy.fallback.contract.test.ts",
|
||||
"src/channels/plugins/contracts/outbound-payload.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-a.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-e.contract.test.ts",
|
||||
];
|
||||
|
||||
export const channelConfigContractPatterns = [
|
||||
"src/channels/plugins/contracts/plugins-core.authorize-config-write.policy.contract.test.ts",
|
||||
"src/channels/plugins/contracts/plugins-core.authorize-config-write.targets.contract.test.ts",
|
||||
"src/channels/plugins/contracts/plugins-core.catalog.entries.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-b.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-f.contract.test.ts",
|
||||
];
|
||||
|
||||
export const channelRegistryContractPatterns = [
|
||||
"src/channels/plugins/contracts/plugins-core.catalog.paths.contract.test.ts",
|
||||
"src/channels/plugins/contracts/plugins-core.loader.contract.test.ts",
|
||||
"src/channels/plugins/contracts/plugins-core.registry.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-c.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-g.contract.test.ts",
|
||||
];
|
||||
|
||||
export const channelSessionContractPatterns = [
|
||||
"src/channels/plugins/contracts/plugins-core.resolve-config-writes.contract.test.ts",
|
||||
"src/channels/plugins/contracts/registry.contract.test.ts",
|
||||
"src/channels/plugins/contracts/session-binding.registry-backed.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-d.contract.test.ts",
|
||||
"src/channels/plugins/contracts/*-shard-h.contract.test.ts",
|
||||
];
|
||||
|
||||
export const pluginContractPatterns = ["src/plugins/contracts/**/*.test.ts"];
|
||||
|
||||
export function loadContractsIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
function narrowContractIncludePatterns(
|
||||
includePatterns: string[],
|
||||
candidatePatterns: string[] | null,
|
||||
): string[] | null {
|
||||
if (!candidatePatterns) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
...new Set(
|
||||
candidatePatterns.filter((candidate) =>
|
||||
includePatterns.some(
|
||||
(pattern) => path.matchesGlob(candidate, pattern) || path.matchesGlob(pattern, candidate),
|
||||
),
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
export function createContractsVitestConfig(
|
||||
includePatterns: string[],
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
argv: string[] = process.argv,
|
||||
options: { name?: string } = {},
|
||||
) {
|
||||
const cliIncludePatterns = narrowIncludePatternsForCli(includePatterns, argv);
|
||||
const envIncludePatterns = narrowContractIncludePatterns(
|
||||
includePatterns,
|
||||
loadContractsIncludePatternsFromEnv(env),
|
||||
);
|
||||
return defineConfig({
|
||||
...base,
|
||||
test: {
|
||||
...baseTest,
|
||||
name: options.name ?? "contracts",
|
||||
isolate: false,
|
||||
runner: nonIsolatedRunnerPath,
|
||||
setupFiles: baseTest.setupFiles ?? [],
|
||||
include: envIncludePatterns ?? cliIncludePatterns ?? includePatterns,
|
||||
passWithNoTests: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
23
test/vitest/vitest.cron.config.ts
Normal file
23
test/vitest/vitest.cron.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// Vitest cron config wires the cron test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createCronVitestConfig(env?: Record<string, string | undefined>) {
|
||||
const config = createScopedVitestConfig(["src/cron/**/*.test.ts"], {
|
||||
dir: "src",
|
||||
env,
|
||||
name: "cron",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
config.test = {
|
||||
...config.test,
|
||||
maxWorkers: 1,
|
||||
fileParallelism: false,
|
||||
sequence: {
|
||||
...config.test?.sequence,
|
||||
groupOrder: 1,
|
||||
},
|
||||
};
|
||||
return config;
|
||||
}
|
||||
|
||||
export default createCronVitestConfig();
|
||||
13
test/vitest/vitest.daemon.config.ts
Normal file
13
test/vitest/vitest.daemon.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Vitest daemon config wires the daemon test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createDaemonVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/daemon/**/*.test.ts"], {
|
||||
dir: "src",
|
||||
env,
|
||||
name: "daemon",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default createDaemonVitestConfig();
|
||||
59
test/vitest/vitest.e2e.config.ts
Normal file
59
test/vitest/vitest.e2e.config.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
// Vitest e2e config wires the e2e test shard.
|
||||
import os from "node:os";
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { BUNDLED_PLUGIN_E2E_TEST_GLOB } from "./vitest.bundled-plugin-paths.ts";
|
||||
import baseConfig from "./vitest.config.ts";
|
||||
import { resolveRepoRootPath } from "./vitest.shared.config.ts";
|
||||
|
||||
const base = baseConfig as unknown as Record<string, unknown>;
|
||||
const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
|
||||
const cpuCount = os.cpus().length;
|
||||
// Keep e2e runs cheap by default; callers can still override via OPENCLAW_E2E_WORKERS.
|
||||
const defaultWorkers = isCI ? Math.min(2, Math.max(1, Math.floor(cpuCount * 0.25))) : 1;
|
||||
const requestedWorkers = Number.parseInt(process.env.OPENCLAW_E2E_WORKERS ?? "", 10);
|
||||
const e2eWorkers =
|
||||
Number.isFinite(requestedWorkers) && requestedWorkers > 0
|
||||
? Math.min(16, requestedWorkers)
|
||||
: defaultWorkers;
|
||||
const verboseE2E = process.env.OPENCLAW_E2E_VERBOSE === "1";
|
||||
|
||||
const baseTestWithProjects =
|
||||
(baseConfig as { test?: { exclude?: string[]; projects?: string[]; setupFiles?: string[] } })
|
||||
.test ?? {};
|
||||
const { projects: _projects, ...baseTest } = baseTestWithProjects as {
|
||||
exclude?: string[];
|
||||
projects?: string[];
|
||||
setupFiles?: string[];
|
||||
};
|
||||
const tuiPtyExcludes = [
|
||||
"src/tui/tui-pty-harness.e2e.test.ts",
|
||||
...(process.arch === "arm64" ? ["src/tui/tui-pty-local.e2e.test.ts"] : []),
|
||||
];
|
||||
const exclude = [
|
||||
...(baseTest.exclude ?? []).filter((p) => p !== "**/*.e2e.test.ts"),
|
||||
...tuiPtyExcludes,
|
||||
];
|
||||
|
||||
export default defineConfig({
|
||||
...base,
|
||||
test: {
|
||||
...baseTest,
|
||||
maxWorkers: e2eWorkers,
|
||||
silent: !verboseE2E,
|
||||
setupFiles: [
|
||||
...new Set(
|
||||
[...(baseTest.setupFiles ?? []), "test/setup-openclaw-runtime.ts"].map(resolveRepoRootPath),
|
||||
),
|
||||
],
|
||||
include: [
|
||||
"test/**/*.e2e.test.ts",
|
||||
"src/**/*.e2e.test.ts",
|
||||
"packages/**/*.e2e.test.ts",
|
||||
"src/gateway/gateway.test.ts",
|
||||
"src/gateway/server.startup-matrix-migration.integration.test.ts",
|
||||
"src/gateway/sessions-history-http.test.ts",
|
||||
BUNDLED_PLUGIN_E2E_TEST_GLOB,
|
||||
],
|
||||
exclude,
|
||||
},
|
||||
});
|
||||
6
test/vitest/vitest.extension-acpx-paths.mjs
Normal file
6
test/vitest/vitest.extension-acpx-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for the ACP extension suite.
|
||||
export const acpxExtensionTestRoots = ["extensions/acpx"];
|
||||
|
||||
export function isAcpxExtensionRoot(root) {
|
||||
return acpxExtensionTestRoots.includes(root);
|
||||
}
|
||||
27
test/vitest/vitest.extension-acpx.config.ts
Normal file
27
test/vitest/vitest.extension-acpx.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Vitest extension acpx config wires the extension acpx test shard.
|
||||
import { acpxExtensionTestRoots } from "./vitest.extension-acpx-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionAcpxVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ?? acpxExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-acpx",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionAcpxVitestConfig();
|
||||
6
test/vitest/vitest.extension-active-memory-paths.mjs
Normal file
6
test/vitest/vitest.extension-active-memory-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for active-memory extension tests.
|
||||
export const activeMemoryExtensionTestRoots = ["extensions/active-memory"];
|
||||
|
||||
export function isActiveMemoryExtensionRoot(root) {
|
||||
return activeMemoryExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-active-memory.config.ts
Normal file
28
test/vitest/vitest.extension-active-memory.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension active memory config wires the extension active memory test shard.
|
||||
import { activeMemoryExtensionTestRoots } from "./vitest.extension-active-memory-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionActiveMemoryVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
activeMemoryExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-active-memory",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionActiveMemoryVitestConfig();
|
||||
6
test/vitest/vitest.extension-browser-paths.mjs
Normal file
6
test/vitest/vitest.extension-browser-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for browser extension tests.
|
||||
export const browserExtensionTestRoots = ["extensions/browser"];
|
||||
|
||||
export function isBrowserExtensionRoot(root) {
|
||||
return browserExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-browser.config.ts
Normal file
28
test/vitest/vitest.extension-browser.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension browser config wires the extension browser test shard.
|
||||
import { browserExtensionTestRoots } from "./vitest.extension-browser-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionBrowserVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
browserExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-browser",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionBrowserVitestConfig();
|
||||
15
test/vitest/vitest.extension-channel-single-config.ts
Normal file
15
test/vitest/vitest.extension-channel-single-config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// Vitest extension channel single config helper supports extension channel single config test configuration.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createSingleChannelExtensionVitestConfig(
|
||||
extensionId: string,
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig([`extensions/${extensionId}/**/*.test.ts`], {
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: `extension-${extensionId}`,
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
});
|
||||
}
|
||||
41
test/vitest/vitest.extension-channel-split-paths.mjs
Normal file
41
test/vitest/vitest.extension-channel-split-paths.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
// Test routing specs for channel plugins split into dedicated Vitest configs.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const splitChannelExtensionShardSpecs = [
|
||||
{
|
||||
id: "discord",
|
||||
kind: "extensionDiscord",
|
||||
config: "test/vitest/vitest.extension-discord.config.ts",
|
||||
},
|
||||
{
|
||||
id: "slack",
|
||||
kind: "extensionSlack",
|
||||
config: "test/vitest/vitest.extension-slack.config.ts",
|
||||
},
|
||||
{
|
||||
id: "signal",
|
||||
kind: "extensionSignal",
|
||||
config: "test/vitest/vitest.extension-signal.config.ts",
|
||||
},
|
||||
{
|
||||
id: "imessage",
|
||||
kind: "extensionImessage",
|
||||
config: "test/vitest/vitest.extension-imessage.config.ts",
|
||||
},
|
||||
{
|
||||
id: "line",
|
||||
kind: "extensionLine",
|
||||
config: "test/vitest/vitest.extension-line.config.ts",
|
||||
},
|
||||
];
|
||||
|
||||
export const splitChannelExtensionTestRoots = splitChannelExtensionShardSpecs.map((spec) =>
|
||||
bundledPluginRoot(spec.id),
|
||||
);
|
||||
|
||||
export function resolveSplitChannelExtensionShard(root) {
|
||||
const normalizedRoot = root.replaceAll("\\", "/");
|
||||
return splitChannelExtensionShardSpecs.find(
|
||||
(spec) => bundledPluginRoot(spec.id) === normalizedRoot,
|
||||
);
|
||||
}
|
||||
20
test/vitest/vitest.extension-channels.config.ts
Normal file
20
test/vitest/vitest.extension-channels.config.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// Vitest extension channels config wires the extension channels test shard.
|
||||
import {
|
||||
extensionChannelOverrideExcludeGlobs,
|
||||
extensionChannelTestInclude,
|
||||
} from "./vitest.channel-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionChannelsVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(extensionChannelTestInclude, {
|
||||
dir: "extensions",
|
||||
env,
|
||||
exclude: extensionChannelOverrideExcludeGlobs,
|
||||
name: "extension-channels",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
}
|
||||
|
||||
export default createExtensionChannelsVitestConfig();
|
||||
10
test/vitest/vitest.extension-clickclack.config.ts
Normal file
10
test/vitest/vitest.extension-clickclack.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Vitest extension clickclack config wires the extension clickclack test shard.
|
||||
import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts";
|
||||
|
||||
export function createExtensionClickClackVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createSingleChannelExtensionVitestConfig("clickclack", env);
|
||||
}
|
||||
|
||||
export default createExtensionClickClackVitestConfig();
|
||||
@@ -0,0 +1,30 @@
|
||||
// Vitest extension codex app server attempt extra config wires the extension codex app server attempt extra test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerAttemptExtraVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
[
|
||||
"extensions/codex/src/app-server/run-attempt-thread-cleanup.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.context-engine.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.dynamic-tools.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.hooks.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.native-hook-relay.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.steering.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.turn-watches.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.usage-limits.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt.vision-tools.test.ts",
|
||||
],
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-attempt-extra",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerAttemptExtraVitestConfig();
|
||||
@@ -0,0 +1,24 @@
|
||||
// Vitest extension codex app server attempt light config wires the extension codex app server attempt light test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerAttemptLightVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
[
|
||||
"extensions/codex/src/app-server/attempt-client-cleanup.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-diagnostics.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-steering.test.ts",
|
||||
],
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-attempt-light",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerAttemptLightVitestConfig();
|
||||
@@ -0,0 +1,26 @@
|
||||
// Vitest extension codex app server attempt support config wires the extension codex app server attempt support test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerAttemptSupportVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
[
|
||||
"extensions/codex/src/app-server/attempt-context.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-results.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-startup.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-timeouts.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-turn-watches.test.ts",
|
||||
],
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-attempt-support",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerAttemptSupportVitestConfig();
|
||||
@@ -0,0 +1,17 @@
|
||||
// Vitest extension codex app server attempt config wires the extension codex app server attempt test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerAttemptVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(["extensions/codex/src/app-server/run-attempt.test.ts"], {
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-attempt",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
});
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerAttemptVitestConfig();
|
||||
@@ -0,0 +1,34 @@
|
||||
// Vitest extension codex app server runtime config wires the extension codex app server runtime test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerRuntimeVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
[
|
||||
"extensions/codex/src/app-server/app-server-policy.test.ts",
|
||||
"extensions/codex/src/app-server/auth-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/auth-profile-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/client.test.ts",
|
||||
"extensions/codex/src/app-server/compact.test.ts",
|
||||
"extensions/codex/src/app-server/config.test.ts",
|
||||
"extensions/codex/src/app-server/managed-binary.test.ts",
|
||||
"extensions/codex/src/app-server/models.test.ts",
|
||||
"extensions/codex/src/app-server/session-binding.test.ts",
|
||||
"extensions/codex/src/app-server/shared-client.test.ts",
|
||||
"extensions/codex/src/app-server/startup-binding.test.ts",
|
||||
"extensions/codex/src/app-server/thread-lifecycle*.test.ts",
|
||||
"extensions/codex/src/app-server/transport-*.test.ts",
|
||||
],
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-runtime",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerRuntimeVitestConfig();
|
||||
@@ -0,0 +1,52 @@
|
||||
// Vitest extension codex app server support config wires the extension codex app server support test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
const coveredAppServerPatterns = [
|
||||
"extensions/codex/src/app-server/attempt-*.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-context.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-diagnostics.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-results.test.ts",
|
||||
"extensions/codex/src/app-server/attempt-steering.test.ts",
|
||||
"extensions/codex/src/app-server/run-attempt*.test.ts",
|
||||
"extensions/codex/src/app-server/app-server-policy.test.ts",
|
||||
"extensions/codex/src/app-server/auth-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/auth-profile-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/client.test.ts",
|
||||
"extensions/codex/src/app-server/compact.test.ts",
|
||||
"extensions/codex/src/app-server/config.test.ts",
|
||||
"extensions/codex/src/app-server/managed-binary.test.ts",
|
||||
"extensions/codex/src/app-server/models.test.ts",
|
||||
"extensions/codex/src/app-server/session-binding.test.ts",
|
||||
"extensions/codex/src/app-server/shared-client.test.ts",
|
||||
"extensions/codex/src/app-server/startup-binding.test.ts",
|
||||
"extensions/codex/src/app-server/thread-lifecycle*.test.ts",
|
||||
"extensions/codex/src/app-server/transport-*.test.ts",
|
||||
"extensions/codex/src/app-server/approval-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/computer-use.test.ts",
|
||||
"extensions/codex/src/app-server/dynamic-tool*.test.ts",
|
||||
"extensions/codex/src/app-server/dynamic-tools.test.ts",
|
||||
"extensions/codex/src/app-server/elicitation-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/native-execution-policy.test.ts",
|
||||
"extensions/codex/src/app-server/native-hook-relay.test.ts",
|
||||
"extensions/codex/src/app-server/openclaw-owned-tool-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/request.test.ts",
|
||||
"extensions/codex/src/app-server/sandbox-exec-server*.test.ts",
|
||||
"extensions/codex/src/app-server/schema-normalization-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/user-input-bridge.test.ts",
|
||||
];
|
||||
|
||||
export function createExtensionCodexAppServerSupportVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(["extensions/codex/src/app-server/**/*.test.ts"], {
|
||||
dir: "extensions",
|
||||
env,
|
||||
exclude: coveredAppServerPatterns,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-support",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
});
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerSupportVitestConfig();
|
||||
@@ -0,0 +1,33 @@
|
||||
// Vitest extension codex app server tools config wires the extension codex app server tools test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexAppServerToolsVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
[
|
||||
"extensions/codex/src/app-server/approval-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/computer-use.test.ts",
|
||||
"extensions/codex/src/app-server/dynamic-tool*.test.ts",
|
||||
"extensions/codex/src/app-server/dynamic-tools.test.ts",
|
||||
"extensions/codex/src/app-server/elicitation-bridge.test.ts",
|
||||
"extensions/codex/src/app-server/native-execution-policy.test.ts",
|
||||
"extensions/codex/src/app-server/native-hook-relay.test.ts",
|
||||
"extensions/codex/src/app-server/openclaw-owned-tool-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/request.test.ts",
|
||||
"extensions/codex/src/app-server/sandbox-exec-server*.test.ts",
|
||||
"extensions/codex/src/app-server/schema-normalization-runtime-contract.test.ts",
|
||||
"extensions/codex/src/app-server/user-input-bridge.test.ts",
|
||||
],
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-app-server-tools",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexAppServerToolsVitestConfig();
|
||||
6
test/vitest/vitest.extension-codex-paths.mjs
Normal file
6
test/vitest/vitest.extension-codex-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for Codex extension tests.
|
||||
export const codexExtensionTestRoots = ["extensions/codex"];
|
||||
|
||||
export function isCodexExtensionRoot(root) {
|
||||
return codexExtensionTestRoots.includes(root);
|
||||
}
|
||||
22
test/vitest/vitest.extension-codex-surface.config.ts
Normal file
22
test/vitest/vitest.extension-codex-surface.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Vitest extension codex surface config wires the extension codex surface test shard.
|
||||
import { codexExtensionTestRoots } from "./vitest.extension-codex-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionCodexSurfaceVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
codexExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
exclude: ["extensions/codex/src/app-server/**/*.test.ts"],
|
||||
fileParallelism: false,
|
||||
name: "extension-codex-surface",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexSurfaceVitestConfig();
|
||||
29
test/vitest/vitest.extension-codex.config.ts
Normal file
29
test/vitest/vitest.extension-codex.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Vitest extension codex config wires the extension codex test shard.
|
||||
import { codexExtensionTestRoots } from "./vitest.extension-codex-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionCodexVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
codexExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-codex",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionCodexVitestConfig();
|
||||
6
test/vitest/vitest.extension-diffs-paths.mjs
Normal file
6
test/vitest/vitest.extension-diffs-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for diffs extension tests.
|
||||
export const diffsExtensionTestRoots = ["extensions/diffs"];
|
||||
|
||||
export function isDiffsExtensionRoot(root) {
|
||||
return diffsExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-diffs.config.ts
Normal file
28
test/vitest/vitest.extension-diffs.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension diffs config wires the extension diffs test shard.
|
||||
import { diffsExtensionTestRoots } from "./vitest.extension-diffs-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionDiffsVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
diffsExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-diffs",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionDiffsVitestConfig();
|
||||
10
test/vitest/vitest.extension-discord.config.ts
Normal file
10
test/vitest/vitest.extension-discord.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Vitest extension discord config wires the extension discord test shard.
|
||||
import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts";
|
||||
|
||||
export function createExtensionDiscordVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createSingleChannelExtensionVitestConfig("discord", env);
|
||||
}
|
||||
|
||||
export default createExtensionDiscordVitestConfig();
|
||||
10
test/vitest/vitest.extension-feishu-paths.mjs
Normal file
10
test/vitest/vitest.extension-feishu-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for Feishu extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const feishuExtensionIds = ["feishu"];
|
||||
|
||||
export const feishuExtensionTestRoots = feishuExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isFeishuExtensionRoot(root) {
|
||||
return feishuExtensionTestRoots.includes(root);
|
||||
}
|
||||
29
test/vitest/vitest.extension-feishu.config.ts
Normal file
29
test/vitest/vitest.extension-feishu.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Vitest extension feishu config wires the extension feishu test shard.
|
||||
import { feishuExtensionTestRoots } from "./vitest.extension-feishu-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionFeishuVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
feishuExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
includeOpenClawRuntimeSetup: false,
|
||||
name: "extension-feishu",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionFeishuVitestConfig();
|
||||
10
test/vitest/vitest.extension-imessage.config.ts
Normal file
10
test/vitest/vitest.extension-imessage.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Vitest extension imessage config wires the extension imessage test shard.
|
||||
import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts";
|
||||
|
||||
export function createExtensionImessageVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createSingleChannelExtensionVitestConfig("imessage", env);
|
||||
}
|
||||
|
||||
export default createExtensionImessageVitestConfig();
|
||||
6
test/vitest/vitest.extension-irc-paths.mjs
Normal file
6
test/vitest/vitest.extension-irc-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for IRC extension tests.
|
||||
export const ircExtensionTestRoots = ["extensions/irc"];
|
||||
|
||||
export function isIrcExtensionRoot(root) {
|
||||
return ircExtensionTestRoots.includes(root);
|
||||
}
|
||||
27
test/vitest/vitest.extension-irc.config.ts
Normal file
27
test/vitest/vitest.extension-irc.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Vitest extension irc config wires the extension irc test shard.
|
||||
import { ircExtensionTestRoots } from "./vitest.extension-irc-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionIrcVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ?? ircExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-irc",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionIrcVitestConfig();
|
||||
10
test/vitest/vitest.extension-line.config.ts
Normal file
10
test/vitest/vitest.extension-line.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Vitest extension line config wires the extension line test shard.
|
||||
import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts";
|
||||
|
||||
export function createExtensionLineVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createSingleChannelExtensionVitestConfig("line", env);
|
||||
}
|
||||
|
||||
export default createExtensionLineVitestConfig();
|
||||
10
test/vitest/vitest.extension-matrix-paths.mjs
Normal file
10
test/vitest/vitest.extension-matrix-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for Matrix extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const matrixExtensionIds = ["matrix"];
|
||||
|
||||
export const matrixExtensionTestRoots = matrixExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isMatrixExtensionRoot(root) {
|
||||
return matrixExtensionTestRoots.includes(root);
|
||||
}
|
||||
18
test/vitest/vitest.extension-matrix.config.ts
Normal file
18
test/vitest/vitest.extension-matrix.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Vitest extension matrix config wires the extension matrix test shard.
|
||||
import { matrixExtensionTestRoots } from "./vitest.extension-matrix-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionMatrixVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(
|
||||
matrixExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-matrix",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMatrixVitestConfig();
|
||||
12
test/vitest/vitest.extension-mattermost-paths.mjs
Normal file
12
test/vitest/vitest.extension-mattermost-paths.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
// Test routing roots for Mattermost extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const mattermostExtensionIds = ["mattermost"];
|
||||
|
||||
export const mattermostExtensionTestRoots = mattermostExtensionIds.map((id) =>
|
||||
bundledPluginRoot(id),
|
||||
);
|
||||
|
||||
export function isMattermostExtensionRoot(root) {
|
||||
return mattermostExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-mattermost.config.ts
Normal file
28
test/vitest/vitest.extension-mattermost.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension mattermost config wires the extension mattermost test shard.
|
||||
import { mattermostExtensionTestRoots } from "./vitest.extension-mattermost-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionMattermostVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
mattermostExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-mattermost",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMattermostVitestConfig();
|
||||
18
test/vitest/vitest.extension-media-paths.mjs
Normal file
18
test/vitest/vitest.extension-media-paths.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
// Test routing roots for media generation, media understanding, and voice plugins.
|
||||
export const mediaExtensionTestRoots = [
|
||||
"extensions/alibaba",
|
||||
"extensions/deepgram",
|
||||
"extensions/elevenlabs",
|
||||
"extensions/fal",
|
||||
"extensions/image-generation-core",
|
||||
"extensions/pixverse",
|
||||
"extensions/runway",
|
||||
"extensions/talk-voice",
|
||||
"extensions/video-generation-core",
|
||||
"extensions/vydra",
|
||||
"extensions/xiaomi",
|
||||
];
|
||||
|
||||
export function isMediaExtensionRoot(root) {
|
||||
return mediaExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-media.config.ts
Normal file
28
test/vitest/vitest.extension-media.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension media config wires the extension media test shard.
|
||||
import { mediaExtensionTestRoots } from "./vitest.extension-media-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionMediaVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
mediaExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-media",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMediaVitestConfig();
|
||||
10
test/vitest/vitest.extension-memory-paths.mjs
Normal file
10
test/vitest/vitest.extension-memory-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for memory extension suites.
|
||||
export const memoryExtensionTestRoots = [
|
||||
"extensions/memory-core",
|
||||
"extensions/memory-lancedb",
|
||||
"extensions/memory-wiki",
|
||||
];
|
||||
|
||||
export function isMemoryExtensionRoot(root) {
|
||||
return memoryExtensionTestRoots.includes(root);
|
||||
}
|
||||
29
test/vitest/vitest.extension-memory.config.ts
Normal file
29
test/vitest/vitest.extension-memory.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Vitest extension memory config wires the extension memory test shard.
|
||||
import { memoryExtensionTestRoots } from "./vitest.extension-memory-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionMemoryVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
memoryExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
isolate: true,
|
||||
name: "extension-memory",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMemoryVitestConfig();
|
||||
18
test/vitest/vitest.extension-messaging-paths.mjs
Normal file
18
test/vitest/vitest.extension-messaging-paths.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
// Test routing roots for miscellaneous messaging extension suites.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const messagingExtensionIds = [
|
||||
"googlechat",
|
||||
"nextcloud-talk",
|
||||
"nostr",
|
||||
"qqbot",
|
||||
"synology-chat",
|
||||
"tlon",
|
||||
"twitch",
|
||||
];
|
||||
|
||||
export const messagingExtensionTestRoots = messagingExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isMessagingExtensionRoot(root) {
|
||||
return messagingExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-messaging.config.ts
Normal file
28
test/vitest/vitest.extension-messaging.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension messaging config wires the extension messaging test shard.
|
||||
import { messagingExtensionTestRoots } from "./vitest.extension-messaging-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionMessagingVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
messagingExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-messaging",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMessagingVitestConfig();
|
||||
31
test/vitest/vitest.extension-misc-paths.mjs
Normal file
31
test/vitest/vitest.extension-misc-paths.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
// Test routing roots for miscellaneous provider/tool extension suites.
|
||||
export const miscExtensionTestRoots = [
|
||||
"extensions/arcee",
|
||||
"extensions/brave",
|
||||
"extensions/device-pair",
|
||||
"extensions/diagnostics-otel",
|
||||
"extensions/duckduckgo",
|
||||
"extensions/exa",
|
||||
"extensions/firecrawl",
|
||||
"extensions/fireworks",
|
||||
"extensions/kilocode",
|
||||
"extensions/litellm",
|
||||
"extensions/llm-task",
|
||||
"extensions/lobster",
|
||||
"extensions/opencode",
|
||||
"extensions/opencode-go",
|
||||
"extensions/openshell",
|
||||
"extensions/parallel",
|
||||
"extensions/perplexity",
|
||||
"extensions/phone-control",
|
||||
"extensions/searxng",
|
||||
"extensions/synthetic",
|
||||
"extensions/tavily",
|
||||
"extensions/thread-ownership",
|
||||
"extensions/vercel-ai-gateway",
|
||||
"extensions/webhooks",
|
||||
];
|
||||
|
||||
export function isMiscExtensionRoot(root) {
|
||||
return miscExtensionTestRoots.includes(root);
|
||||
}
|
||||
27
test/vitest/vitest.extension-misc.config.ts
Normal file
27
test/vitest/vitest.extension-misc.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Vitest extension misc config wires the extension misc test shard.
|
||||
import { miscExtensionTestRoots } from "./vitest.extension-misc-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionMiscVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ?? miscExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-misc",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMiscVitestConfig();
|
||||
10
test/vitest/vitest.extension-msteams-paths.mjs
Normal file
10
test/vitest/vitest.extension-msteams-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for Microsoft Teams extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const msTeamsExtensionIds = ["msteams"];
|
||||
|
||||
export const msTeamsExtensionTestRoots = msTeamsExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isMsTeamsExtensionRoot(root) {
|
||||
return msTeamsExtensionTestRoots.includes(root);
|
||||
}
|
||||
18
test/vitest/vitest.extension-msteams.config.ts
Normal file
18
test/vitest/vitest.extension-msteams.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Vitest extension msteams config wires the extension msteams test shard.
|
||||
import { msTeamsExtensionTestRoots } from "./vitest.extension-msteams-paths.mjs";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionMsTeamsVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(
|
||||
msTeamsExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-msteams",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionMsTeamsVitestConfig();
|
||||
43
test/vitest/vitest.extension-provider-openai.config.ts
Normal file
43
test/vitest/vitest.extension-provider-openai.config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Vitest extension provider openai config wires the extension provider openai test shard.
|
||||
import path from "node:path";
|
||||
import { providerOpenAiExtensionTestRoots } from "./vitest.extension-provider-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
import { repoRoot } from "./vitest.shared.config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionProviderOpenAiVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
const config = createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
providerOpenAiExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-provider-openai",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
return {
|
||||
...config,
|
||||
resolve: {
|
||||
...config.resolve,
|
||||
alias: [
|
||||
...(Array.isArray(config.resolve?.alias) ? config.resolve.alias : []),
|
||||
{
|
||||
find: /^ws$/u,
|
||||
replacement: path.join(repoRoot, "node_modules", "ws", "wrapper.mjs"),
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default createExtensionProviderOpenAiVitestConfig();
|
||||
50
test/vitest/vitest.extension-provider-paths.mjs
Normal file
50
test/vitest/vitest.extension-provider-paths.mjs
Normal file
@@ -0,0 +1,50 @@
|
||||
// Test routing roots for model provider extension suites.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const providerExtensionIds = [
|
||||
"amazon-bedrock",
|
||||
"amazon-bedrock-mantle",
|
||||
"anthropic",
|
||||
"anthropic-vertex",
|
||||
"byteplus",
|
||||
"chutes",
|
||||
"comfy",
|
||||
"deepseek",
|
||||
"github-copilot",
|
||||
"google",
|
||||
"groq",
|
||||
"huggingface",
|
||||
"kimi-coding",
|
||||
"lmstudio",
|
||||
"microsoft",
|
||||
"microsoft-foundry",
|
||||
"minimax",
|
||||
"mistral",
|
||||
"qwen",
|
||||
"moonshot",
|
||||
"nvidia",
|
||||
"ollama",
|
||||
"openrouter",
|
||||
"qianfan",
|
||||
"stepfun",
|
||||
"together",
|
||||
"venice",
|
||||
"volcengine",
|
||||
"xai",
|
||||
"zai",
|
||||
];
|
||||
|
||||
export const providerOpenAiExtensionIds = ["openai"];
|
||||
|
||||
export const providerExtensionTestRoots = providerExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
export const providerOpenAiExtensionTestRoots = providerOpenAiExtensionIds.map((id) =>
|
||||
bundledPluginRoot(id),
|
||||
);
|
||||
|
||||
export function isProviderExtensionRoot(root) {
|
||||
return providerExtensionTestRoots.includes(root);
|
||||
}
|
||||
|
||||
export function isProviderOpenAiExtensionRoot(root) {
|
||||
return providerOpenAiExtensionTestRoots.includes(root);
|
||||
}
|
||||
29
test/vitest/vitest.extension-providers.config.ts
Normal file
29
test/vitest/vitest.extension-providers.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Vitest extension providers config wires the extension providers test shard.
|
||||
import { providerExtensionTestRoots } from "./vitest.extension-provider-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionProvidersVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
providerExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
isolate: true,
|
||||
name: "extension-providers",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionProvidersVitestConfig();
|
||||
6
test/vitest/vitest.extension-qa-paths.mjs
Normal file
6
test/vitest/vitest.extension-qa-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for QA channel/lab extension tests.
|
||||
export const qaExtensionTestRoots = ["extensions/qa-channel", "extensions/qa-lab"];
|
||||
|
||||
export function isQaExtensionRoot(root) {
|
||||
return qaExtensionTestRoots.includes(root);
|
||||
}
|
||||
27
test/vitest/vitest.extension-qa.config.ts
Normal file
27
test/vitest/vitest.extension-qa.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Vitest extension qa config wires the extension qa test shard.
|
||||
import { qaExtensionTestRoots } from "./vitest.extension-qa-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionQaVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ?? qaExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-qa",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionQaVitestConfig();
|
||||
10
test/vitest/vitest.extension-signal.config.ts
Normal file
10
test/vitest/vitest.extension-signal.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Vitest extension signal config wires the extension signal test shard.
|
||||
import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts";
|
||||
|
||||
export function createExtensionSignalVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createSingleChannelExtensionVitestConfig("signal", env);
|
||||
}
|
||||
|
||||
export default createExtensionSignalVitestConfig();
|
||||
18
test/vitest/vitest.extension-slack.config.ts
Normal file
18
test/vitest/vitest.extension-slack.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Vitest extension slack config wires the extension slack test shard.
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createExtensionSlackVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(["extensions/slack/**/*.test.ts"], {
|
||||
dir: "extensions",
|
||||
env,
|
||||
includeOpenClawRuntimeSetup: false,
|
||||
name: "extension-slack",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
fileParallelism: false,
|
||||
});
|
||||
}
|
||||
|
||||
export default createExtensionSlackVitestConfig();
|
||||
6
test/vitest/vitest.extension-telegram-paths.mjs
Normal file
6
test/vitest/vitest.extension-telegram-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for Telegram extension tests.
|
||||
export const telegramExtensionTestRoots = ["extensions/telegram"];
|
||||
|
||||
export function isTelegramExtensionRoot(root) {
|
||||
return telegramExtensionTestRoots.includes(root);
|
||||
}
|
||||
29
test/vitest/vitest.extension-telegram.config.ts
Normal file
29
test/vitest/vitest.extension-telegram.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// Vitest extension telegram config wires the extension telegram test shard.
|
||||
import { telegramExtensionTestRoots } from "./vitest.extension-telegram-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionTelegramVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
telegramExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
fileParallelism: false,
|
||||
name: "extension-telegram",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionTelegramVitestConfig();
|
||||
10
test/vitest/vitest.extension-voice-call-paths.mjs
Normal file
10
test/vitest/vitest.extension-voice-call-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for voice-call extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const voiceCallExtensionIds = ["voice-call"];
|
||||
|
||||
export const voiceCallExtensionTestRoots = voiceCallExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isVoiceCallExtensionRoot(root) {
|
||||
return voiceCallExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-voice-call.config.ts
Normal file
28
test/vitest/vitest.extension-voice-call.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension voice call config wires the extension voice call test shard.
|
||||
import { voiceCallExtensionTestRoots } from "./vitest.extension-voice-call-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionVoiceCallVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
voiceCallExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-voice-call",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionVoiceCallVitestConfig();
|
||||
10
test/vitest/vitest.extension-whatsapp-paths.mjs
Normal file
10
test/vitest/vitest.extension-whatsapp-paths.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
// Test routing roots for WhatsApp extension tests.
|
||||
import { bundledPluginRoot } from "../../scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
export const whatsAppExtensionIds = ["whatsapp"];
|
||||
|
||||
export const whatsAppExtensionTestRoots = whatsAppExtensionIds.map((id) => bundledPluginRoot(id));
|
||||
|
||||
export function isWhatsAppExtensionRoot(root) {
|
||||
return whatsAppExtensionTestRoots.includes(root);
|
||||
}
|
||||
28
test/vitest/vitest.extension-whatsapp.config.ts
Normal file
28
test/vitest/vitest.extension-whatsapp.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Vitest extension whatsapp config wires the extension whatsapp test shard.
|
||||
import { whatsAppExtensionTestRoots } from "./vitest.extension-whatsapp-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionWhatsAppVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ??
|
||||
whatsAppExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-whatsapp",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionWhatsAppVitestConfig();
|
||||
6
test/vitest/vitest.extension-zalo-paths.mjs
Normal file
6
test/vitest/vitest.extension-zalo-paths.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Test routing roots for Zalo extension tests.
|
||||
export const zaloExtensionTestRoots = ["extensions/zalo", "extensions/zalouser"];
|
||||
|
||||
export function isZaloExtensionRoot(root) {
|
||||
return zaloExtensionTestRoots.includes(root);
|
||||
}
|
||||
27
test/vitest/vitest.extension-zalo.config.ts
Normal file
27
test/vitest/vitest.extension-zalo.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Vitest extension zalo config wires the extension zalo test shard.
|
||||
import { zaloExtensionTestRoots } from "./vitest.extension-zalo-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionZaloVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(
|
||||
loadIncludePatternsFromEnv(env) ?? zaloExtensionTestRoots.map((root) => `${root}/**/*.test.ts`),
|
||||
{
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extension-zalo",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default createExtensionZaloVitestConfig();
|
||||
74
test/vitest/vitest.extensions.config.ts
Normal file
74
test/vitest/vitest.extensions.config.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
// Vitest extensions config wires the extensions test shard.
|
||||
import { BUNDLED_PLUGIN_TEST_GLOB } from "./vitest.bundled-plugin-paths.ts";
|
||||
import { extensionExcludedChannelTestGlobs } from "./vitest.channel-paths.mjs";
|
||||
import { acpxExtensionTestRoots } from "./vitest.extension-acpx-paths.mjs";
|
||||
import { activeMemoryExtensionTestRoots } from "./vitest.extension-active-memory-paths.mjs";
|
||||
import { browserExtensionTestRoots } from "./vitest.extension-browser-paths.mjs";
|
||||
import { codexExtensionTestRoots } from "./vitest.extension-codex-paths.mjs";
|
||||
import { diffsExtensionTestRoots } from "./vitest.extension-diffs-paths.mjs";
|
||||
import { feishuExtensionTestRoots } from "./vitest.extension-feishu-paths.mjs";
|
||||
import { ircExtensionTestRoots } from "./vitest.extension-irc-paths.mjs";
|
||||
import { matrixExtensionTestRoots } from "./vitest.extension-matrix-paths.mjs";
|
||||
import { mattermostExtensionTestRoots } from "./vitest.extension-mattermost-paths.mjs";
|
||||
import { mediaExtensionTestRoots } from "./vitest.extension-media-paths.mjs";
|
||||
import { memoryExtensionTestRoots } from "./vitest.extension-memory-paths.mjs";
|
||||
import { messagingExtensionTestRoots } from "./vitest.extension-messaging-paths.mjs";
|
||||
import { miscExtensionTestRoots } from "./vitest.extension-misc-paths.mjs";
|
||||
import { msTeamsExtensionTestRoots } from "./vitest.extension-msteams-paths.mjs";
|
||||
import {
|
||||
providerExtensionTestRoots,
|
||||
providerOpenAiExtensionTestRoots,
|
||||
} from "./vitest.extension-provider-paths.mjs";
|
||||
import { qaExtensionTestRoots } from "./vitest.extension-qa-paths.mjs";
|
||||
import { telegramExtensionTestRoots } from "./vitest.extension-telegram-paths.mjs";
|
||||
import { voiceCallExtensionTestRoots } from "./vitest.extension-voice-call-paths.mjs";
|
||||
import { whatsAppExtensionTestRoots } from "./vitest.extension-whatsapp-paths.mjs";
|
||||
import { zaloExtensionTestRoots } from "./vitest.extension-zalo-paths.mjs";
|
||||
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function loadIncludePatternsFromEnv(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
): string[] | null {
|
||||
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
||||
}
|
||||
|
||||
export function createExtensionsVitestConfig(
|
||||
env: Record<string, string | undefined> = process.env,
|
||||
) {
|
||||
return createScopedVitestConfig(loadIncludePatternsFromEnv(env) ?? [BUNDLED_PLUGIN_TEST_GLOB], {
|
||||
dir: "extensions",
|
||||
env,
|
||||
name: "extensions",
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
// Some bundled plugins still run on the channel surface; keep those roots
|
||||
// out of the shared extensions lane.
|
||||
exclude: [
|
||||
...extensionExcludedChannelTestGlobs,
|
||||
...activeMemoryExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...acpxExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...browserExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...codexExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...diffsExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...feishuExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...ircExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...matrixExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...mattermostExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...mediaExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...memoryExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...messagingExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...miscExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...msTeamsExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...providerOpenAiExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...providerExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...qaExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...telegramExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...voiceCallExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...whatsAppExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
...zaloExtensionTestRoots.map((root) => `${root.replace(/^extensions\//u, "")}/**`),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
export default createExtensionsVitestConfig();
|
||||
9
test/vitest/vitest.full-agentic.config.ts
Normal file
9
test/vitest/vitest.full-agentic.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full agentic config wires the full agentic test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-agentic.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-auto-reply.config.ts
Normal file
9
test/vitest/vitest.full-auto-reply.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full auto reply config wires the full auto reply test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-auto-reply.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-core-bundled.config.ts
Normal file
9
test/vitest/vitest.full-core-bundled.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core bundled config wires the full core bundled test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-bundled.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-core-contracts.config.ts
Normal file
9
test/vitest/vitest.full-core-contracts.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core contracts config wires the full core contracts test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-contracts.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-core-runtime.config.ts
Normal file
9
test/vitest/vitest.full-core-runtime.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core runtime config wires the full core runtime test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-runtime.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-core-support-boundary.config.ts
Normal file
9
test/vitest/vitest.full-core-support-boundary.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core support boundary config wires the full core support boundary test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-support-boundary.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
9
test/vitest/vitest.full-core-tooling.config.ts
Normal file
9
test/vitest/vitest.full-core-tooling.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core tooling config wires the full core tooling test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-tooling.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
15
test/vitest/vitest.full-core-unit-fast.config.ts
Normal file
15
test/vitest/vitest.full-core-unit-fast.config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// Vitest full core unit fast config wires the full core unit fast test shard.
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { sharedVitestConfig } from "./vitest.shared.config.ts";
|
||||
|
||||
export default defineConfig({
|
||||
...sharedVitestConfig,
|
||||
test: {
|
||||
...sharedVitestConfig.test,
|
||||
runner: undefined,
|
||||
projects: [
|
||||
"test/vitest/vitest.unit-fast.config.ts",
|
||||
"test/vitest/vitest.unit-fast-fake-timers.config.ts",
|
||||
],
|
||||
},
|
||||
});
|
||||
9
test/vitest/vitest.full-core-unit-security.config.ts
Normal file
9
test/vitest/vitest.full-core-unit-security.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
// Vitest full core unit security config wires the full core unit security test shard.
|
||||
import { createProjectShardVitestConfig } from "./vitest.project-shard-config.ts";
|
||||
import { fullSuiteVitestShards } from "./vitest.test-shards.mjs";
|
||||
|
||||
export default createProjectShardVitestConfig(
|
||||
fullSuiteVitestShards.find(
|
||||
(shard) => shard.config === "test/vitest/vitest.full-core-unit-security.config.ts",
|
||||
)?.projects ?? [],
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user