ci(test): split command shards and harden release checks

This commit is contained in:
Peter Steinberger
2026-04-29 05:59:50 +01:00
parent 7c7561f5a3
commit 3a6f7d8db9
8 changed files with 222 additions and 38 deletions

View File

@@ -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",

View File

@@ -283,7 +283,15 @@ describe("package artifact reuse", () => {
'pnpm openclaw qa matrix --help 2>/dev/null | grep -F -q -- "--fail-fast"',
);
expect(releaseWorkflow).toContain("matrix_args+=(--fail-fast)");
expect(releaseWorkflow).toContain('pnpm openclaw qa matrix "${matrix_args[@]}"');
expect(releaseWorkflow).toContain(
'pnpm openclaw qa matrix --output-dir "${attempt_output_dir}" "${matrix_args[@]}"',
);
expect(releaseWorkflow).toContain(
'echo "Matrix live lane failed on attempt ${attempt}; retrying once..." >&2',
);
expect(releaseWorkflow).toContain(
'echo "Telegram live lane failed on attempt ${attempt}; retrying once..." >&2',
);
expect(qaWorkflow).toContain(
'pnpm openclaw qa matrix --help 2>/dev/null | grep -F -q -- "--fail-fast"',
);