mirror of https://github.com/openclaw/openclaw.git
test: route telegram plugin tests through extensions
This commit is contained in:
parent
0a2a1ff778
commit
db6d149f75
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -58,7 +58,6 @@ const targetedChannelProxyFiles = [
|
|||
...sharedTargetedChannelProxyFiles,
|
||||
bundledPluginFile("discord", "src/monitor/message-handler.preflight.acp-bindings.test.ts"),
|
||||
bundledPluginFile("discord", "src/monitor/monitor.agent-components.test.ts"),
|
||||
bundledPluginFile("telegram", "src/bot.create-telegram-bot.test.ts"),
|
||||
bundledPluginFile("whatsapp", "src/monitor-inbox.streams-inbound-messages.test.ts"),
|
||||
];
|
||||
|
||||
|
|
@ -447,10 +446,10 @@ describe("scripts/test-parallel lane planning", () => {
|
|||
expect(output).not.toContain("vitest.unit.config.ts");
|
||||
});
|
||||
|
||||
it("routes telegram fetch transport coverage through the extensions config", () => {
|
||||
it("routes telegram plugin coverage through the extensions config", () => {
|
||||
const output = runPlannerPlan([
|
||||
"--explain",
|
||||
bundledPluginFile("telegram", "src/fetch.test.ts"),
|
||||
bundledPluginFile("telegram", "src/bot.create-telegram-bot.test.ts"),
|
||||
]);
|
||||
|
||||
expect(output).toContain("surface=extensions");
|
||||
|
|
|
|||
|
|
@ -822,12 +822,12 @@ describe("test planner", () => {
|
|||
|
||||
expect(manifest.jobs.buildArtifacts.enabled).toBe(true);
|
||||
expect(manifest.shardCounts.unit).toBe(4);
|
||||
expect(manifest.shardCounts.channels).toBe(4);
|
||||
expect(manifest.shardCounts.channels).toBe(3);
|
||||
expect(manifest.shardCounts.extensionFast).toBeGreaterThanOrEqual(4);
|
||||
expect(manifest.shardCounts.extensionFast).toBeLessThanOrEqual(6);
|
||||
expect(manifest.shardCounts.windows).toBe(6);
|
||||
expect(manifest.shardCounts.macosNode).toBe(9);
|
||||
expect(manifest.jobs.checks.matrix.include).toHaveLength(8);
|
||||
expect(manifest.jobs.checks.matrix.include).toHaveLength(7);
|
||||
expect(manifest.jobs.checksWindows.matrix.include).toHaveLength(6);
|
||||
expect(manifest.jobs.macosNode.matrix.include).toHaveLength(9);
|
||||
expect(manifest.jobs.checksFast.matrix.include).toHaveLength(
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ describe("scoped vitest configs", () => {
|
|||
expect(defaultExtensionsConfig.test?.include).toEqual(["**/*.test.ts"]);
|
||||
});
|
||||
|
||||
it("keeps telegram fetch transport coverage in extensions while excluding other telegram channel suites", () => {
|
||||
it("keeps telegram plugin tests in extensions while excluding channel-surface plugin roots", () => {
|
||||
const extensionExcludes = defaultExtensionsConfig.test?.exclude ?? [];
|
||||
expect(
|
||||
extensionExcludes.some((pattern) => path.matchesGlob("telegram/src/fetch.test.ts", pattern)),
|
||||
|
|
@ -116,12 +116,10 @@ describe("scoped vitest configs", () => {
|
|||
path.matchesGlob("telegram/src/bot/delivery.resolve-media-retry.test.ts", pattern),
|
||||
),
|
||||
).toBe(false);
|
||||
expect(defaultChannelsConfig.test?.exclude).toContain(
|
||||
expect(defaultChannelsConfig.test?.include).not.toContain("extensions/telegram/**/*.test.ts");
|
||||
expect(defaultChannelsConfig.test?.exclude).not.toContain(
|
||||
bundledPluginFile("telegram", "src/fetch.test.ts"),
|
||||
);
|
||||
expect(defaultChannelsConfig.test?.exclude).toContain(
|
||||
bundledPluginFile("telegram", "src/bot/delivery.resolve-media-retry.test.ts"),
|
||||
);
|
||||
expect(defaultExtensionsConfig.test?.setupFiles).toEqual(["test/setup.extensions.ts"]);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
import path from "node:path";
|
||||
import {
|
||||
BUNDLED_PLUGIN_PATH_PREFIX,
|
||||
bundledPluginFile,
|
||||
bundledPluginRoot,
|
||||
} from "./scripts/lib/bundled-plugin-paths.mjs";
|
||||
|
||||
const normalizeRepoPath = (value) => value.split(path.sep).join("/");
|
||||
|
||||
export const extensionRoutedChannelTestFiles = [
|
||||
bundledPluginFile("telegram", "src/bot/delivery.resolve-media-retry.test.ts"),
|
||||
bundledPluginFile("telegram", "src/fetch.test.ts"),
|
||||
];
|
||||
export const extensionRoutedChannelTestFiles = [];
|
||||
|
||||
const extensionRoutedChannelTestFileSet = new Set(extensionRoutedChannelTestFiles);
|
||||
|
||||
export const channelTestRoots = [
|
||||
bundledPluginRoot("telegram"),
|
||||
bundledPluginRoot("discord"),
|
||||
bundledPluginRoot("whatsapp"),
|
||||
bundledPluginRoot("slack"),
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ export function createExtensionsVitestConfig(
|
|||
env,
|
||||
passWithNoTests: true,
|
||||
setupFiles: ["test/setup.extensions.ts"],
|
||||
// Most channel implementations stay on the channel surface, but a few
|
||||
// transport-only suites live better in the general extensions lane.
|
||||
// Some bundled plugins still run on the channel surface; keep those roots
|
||||
// out of the shared extensions lane.
|
||||
exclude: extensionExcludedChannelTestGlobs,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue