mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 15:25:14 +00:00
ci(release): apply exact extension batch excludes
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
import { buildVitestBatchPnpmArgs } from "../../scripts/lib/vitest-batch-runner.mjs";
|
||||
import {
|
||||
parseExtensionIds,
|
||||
parseExactVitestExcludePaths,
|
||||
resolveExtensionBatchParallelism,
|
||||
runExtensionBatchPlan,
|
||||
} from "../../scripts/test-extension-batch.mjs";
|
||||
@@ -626,6 +627,46 @@ describe("scripts/test-extension.mjs", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("expands extension batch roots before applying exact Vitest excludes", async () => {
|
||||
const runGroup = vi.fn<() => Promise<number>>().mockResolvedValue(0);
|
||||
await runExtensionBatchPlan(
|
||||
{
|
||||
extensionCount: 1,
|
||||
extensionIds: ["codex"],
|
||||
estimatedCost: 1,
|
||||
hasTests: true,
|
||||
planGroups: [
|
||||
{
|
||||
config: "test/vitest/vitest.extensions.config.ts",
|
||||
estimatedCost: 1,
|
||||
extensionIds: ["codex"],
|
||||
roots: [bundledPluginRoot("codex")],
|
||||
testFileCount: 1,
|
||||
},
|
||||
],
|
||||
testFileCount: 1,
|
||||
},
|
||||
{
|
||||
runGroup,
|
||||
vitestArgs: ["--exclude", "extensions/codex/src/app-server/run-attempt.test.ts"],
|
||||
},
|
||||
);
|
||||
|
||||
const runParams = requireFirstMockArg<RunGroupParams>(runGroup);
|
||||
expect(runParams.targets).not.toContain("extensions/codex/src/app-server/run-attempt.test.ts");
|
||||
expect(runParams.targets).toContain("extensions/codex/src/app-server/client.test.ts");
|
||||
});
|
||||
|
||||
it("detects exact Vitest excludes in extension batch args", () => {
|
||||
expect([
|
||||
...parseExactVitestExcludePaths([
|
||||
"--exclude",
|
||||
"extensions/codex/src/app-server/run-attempt.test.ts",
|
||||
]),
|
||||
]).toEqual(["extensions/codex/src/app-server/run-attempt.test.ts"]);
|
||||
expect([...parseExactVitestExcludePaths(["--exclude=extensions/**/*.test.ts"])]).toEqual([]);
|
||||
});
|
||||
|
||||
it("treats extensions without tests as a no-op by default", () => {
|
||||
const extensionId = findExtensionWithoutTests();
|
||||
const stdout = runScript([extensionId]);
|
||||
|
||||
Reference in New Issue
Block a user