mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:10:58 +00:00
ci(test): split command shards and harden release checks
This commit is contained in:
@@ -3,6 +3,7 @@ import { join, relative, resolve } from "node:path";
|
||||
import fg from "fast-glob";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createNodeTestShards } from "../../scripts/lib/ci-node-test-plan.mjs";
|
||||
import { commandsLightTestFiles } from "../vitest/vitest.commands-light-paths.mjs";
|
||||
import { createPluginsVitestConfig } from "../vitest/vitest.plugins.config.ts";
|
||||
|
||||
type VitestTestConfig = {
|
||||
@@ -169,10 +170,14 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("splits the agentic lane into control-plane, commands, agent, SDK, and plugin shards", () => {
|
||||
it("splits the agentic lane into control-plane, command, agent, SDK, and plugin shards", () => {
|
||||
const shards = createNodeTestShards();
|
||||
const controlPlaneShard = shards.find((shard) => shard.shardName === "agentic-control-plane");
|
||||
const commandsShard = shards.find((shard) => shard.shardName === "agentic-commands");
|
||||
const cliShard = shards.find((shard) => shard.shardName === "agentic-cli");
|
||||
const commandSupportShard = shards.find(
|
||||
(shard) => shard.shardName === "agentic-command-support",
|
||||
);
|
||||
const commandShards = shards.filter((shard) => shard.shardName.startsWith("agentic-commands-"));
|
||||
const agentShard = shards.find((shard) => shard.shardName === "agentic-agents");
|
||||
const pluginSdkShard = shards.find((shard) => shard.shardName === "agentic-plugin-sdk");
|
||||
const pluginsShard = shards.find((shard) => shard.shardName === "agentic-plugins");
|
||||
@@ -184,17 +189,46 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => {
|
||||
runner: "blacksmith-4vcpu-ubuntu-2404",
|
||||
requiresDist: false,
|
||||
});
|
||||
expect(commandsShard).toEqual({
|
||||
checkName: "checks-node-agentic-commands",
|
||||
shardName: "agentic-commands",
|
||||
expect(cliShard).toEqual({
|
||||
checkName: "checks-node-agentic-cli",
|
||||
shardName: "agentic-cli",
|
||||
configs: ["test/vitest/vitest.cli.config.ts"],
|
||||
requiresDist: false,
|
||||
});
|
||||
expect(commandSupportShard).toEqual({
|
||||
checkName: "checks-node-agentic-command-support",
|
||||
shardName: "agentic-command-support",
|
||||
configs: [
|
||||
"test/vitest/vitest.cli.config.ts",
|
||||
"test/vitest/vitest.commands-light.config.ts",
|
||||
"test/vitest/vitest.commands.config.ts",
|
||||
"test/vitest/vitest.daemon.config.ts",
|
||||
],
|
||||
requiresDist: false,
|
||||
});
|
||||
expect(commandShards.map((shard) => shard.shardName)).toEqual([
|
||||
"agentic-commands-agent-channel",
|
||||
"agentic-commands-doctor",
|
||||
"agentic-commands-doctor-shared",
|
||||
"agentic-commands-models",
|
||||
"agentic-commands-onboard-config",
|
||||
"agentic-commands-status-tools",
|
||||
]);
|
||||
expect(commandShards).toEqual(
|
||||
commandShards.map((shard) => ({
|
||||
checkName: `checks-node-${shard.shardName}`,
|
||||
configs: ["test/vitest/vitest.commands.config.ts"],
|
||||
includePatterns: shard.includePatterns,
|
||||
requiresDist: false,
|
||||
shardName: shard.shardName,
|
||||
})),
|
||||
);
|
||||
const commandShardFiles = commandShards
|
||||
.flatMap((shard) => shard.includePatterns ?? [])
|
||||
.toSorted((a, b) => a.localeCompare(b));
|
||||
const expectedCommandFiles = listTestFiles("src/commands")
|
||||
.filter((file) => !commandsLightTestFiles.includes(file))
|
||||
.toSorted((a, b) => a.localeCompare(b));
|
||||
expect(commandShardFiles).toEqual(expectedCommandFiles);
|
||||
expect(new Set(commandShardFiles).size).toBe(commandShardFiles.length);
|
||||
expect(agentShard).toEqual({
|
||||
checkName: "checks-node-agentic-agents",
|
||||
shardName: "agentic-agents",
|
||||
|
||||
Reference in New Issue
Block a user