perf: route browser and line extension tests

This commit is contained in:
Peter Steinberger 2026-04-04 02:08:14 +01:00
parent 1e90b3afcd
commit 34cd49faa6
No known key found for this signature in database
3 changed files with 36 additions and 13 deletions

View File

@ -249,6 +249,28 @@ describe("test-projects args", () => {
]);
});
it("routes browser extension targets to the extension channel config", () => {
expect(buildVitestRunPlans(["extensions/browser/index.test.ts"])).toEqual([
{
config: "vitest.extension-channels.config.ts",
forwardedArgs: [],
includePatterns: ["extensions/browser/index.test.ts"],
watchMode: false,
},
]);
});
it("routes line extension targets to the extension channel config", () => {
expect(buildVitestRunPlans(["extensions/line/src/send.test.ts"])).toEqual([
{
config: "vitest.extension-channels.config.ts",
forwardedArgs: [],
includePatterns: ["extensions/line/src/send.test.ts"],
watchMode: false,
},
]);
});
it("routes direct provider extension file targets to the extensions config", () => {
expect(buildVitestRunPlans(["extensions/firecrawl/index.test.ts"])).toEqual([
{

View File

@ -83,10 +83,7 @@ describe("scoped vitest configs", () => {
});
it("keeps the core channel lane limited to non-extension roots", () => {
expect(defaultChannelsConfig.test?.include).toEqual([
"src/browser/**/*.test.ts",
"src/line/**/*.test.ts",
]);
expect(defaultChannelsConfig.test?.include).toEqual([]);
});
it("loads channel include overrides from OPENCLAW_VITEST_INCLUDE_FILE", () => {
@ -123,13 +120,17 @@ describe("scoped vitest configs", () => {
it("normalizes extension channel include patterns relative to the scoped dir", () => {
expect(defaultExtensionChannelsConfig.test?.dir).toBe("extensions");
expect(defaultExtensionChannelsConfig.test?.include).toEqual([
"discord/**/*.test.ts",
"whatsapp/**/*.test.ts",
"slack/**/*.test.ts",
"signal/**/*.test.ts",
"imessage/**/*.test.ts",
]);
expect(defaultExtensionChannelsConfig.test?.include).toEqual(
expect.arrayContaining([
"browser/**/*.test.ts",
"discord/**/*.test.ts",
"line/**/*.test.ts",
"whatsapp/**/*.test.ts",
"slack/**/*.test.ts",
"signal/**/*.test.ts",
"imessage/**/*.test.ts",
]),
);
});
it("normalizes extension include patterns relative to the scoped dir", () => {

View File

@ -16,8 +16,8 @@ export const channelTestRoots = [
bundledPluginRoot("slack"),
bundledPluginRoot("signal"),
bundledPluginRoot("imessage"),
"src/browser",
"src/line",
bundledPluginRoot("browser"),
bundledPluginRoot("line"),
];
export const extensionChannelTestRoots = channelTestRoots.filter((root) =>