Skip to content

Commit b03d650

Browse files
committed
1 parent a48092b commit b03d650

3 files changed

Lines changed: 44 additions & 14 deletions

File tree

‎docs/ci.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The slowest Node test families are split or balanced so each job stays small wit
118118
- Core unit fast/support lanes run separately; core runtime infra splits into process, shared, hooks, secrets, and three cron domain shards.
119119
- Auto-reply runs as balanced workers, with the reply subtree split into agent-runner, commands, dispatch, session, and state-routing shards.
120120
- Agentic gateway/server (control-plane) configs split across chat, auth, model, HTTP/plugin, runtime, and startup lanes instead of waiting on built artifacts.
121-
- Normal CI packs only isolated infra include-pattern shards into deterministic bundles of at most 64 test files, reducing the Node matrix without merging non-isolated command/cron, stateful agents-core, or gateway/server suites. Heavy fixed suites stay on 8 vCPU while the bundled and lower-weight lanes use 4 vCPU.
121+
- Normal CI packs only isolated infra include-pattern shards into deterministic bundles of at most 64 test files, reducing the Node matrix without merging non-isolated command/cron, stateful agents-core, or gateway/server suites. Heavy fixed suites stay on 8 vCPU while most bundled and lower-weight lanes use 4 vCPU. Compact-small bins 2, 5, and 8 use existing 8-vCPU capacity because recent hosted runs showed they repeatedly owned the critical path while the 4-vCPU queue was materially longer; routing happens after packing, so group ownership, coverage, and the existing registration count do not change.
122122
- Pull requests on the canonical repository reuse the changed-test resolver against the synthetic merged-tree diff. Precise changes run one targeted Node job; each selected test file gets its own process so stateful suite isolation remains intact. The planner combines sibling tests with import-graph dependents and falls back to the existing 23-job compact full-suite plan for workspace package, package/lockfile, shared harness, split-config, renamed, or deleted changes, public extension-contract changes, tests with special shard setup, partially resolved or empty targets, oversized path or target plans, and planner errors. Targeted plans always retain the full built-artifact boundary gate because its repository scanners cannot be derived from imports. `main` pushes run the same full compact suite: pending intermediate push events can be coalesced, so the newest surviving run must validate the complete integration tree rather than only its final single-push diff. Manual dispatches and release gates retain the full named per-shard matrix. Compact packing uses median group walls refreshed from multiple successful hosted runs without changing the bounded job count; the high-variance source/security group remains isolated so its tail does not serialize unrelated groups.
123123
- The full Node matrix admits the consistently slow serial tooling, auto-reply command shards, and broad core-fast cache writer first. This keeps the 28-job cap while preventing critical-path work and the next run's transform seed from slipping into a later wave.
124124
- The three serial Control UI browser shards greedily pack discovered test files by source byte size. This zero-state duration proxy avoids Vitest's equal-file-count hash clustering, automatically accounts for new and changed files, and preserves the same complete test inventory without adding runners.
@@ -190,15 +190,15 @@ for commands and recovery.
190190

191191
## Runners
192192

193-
| Runner | Jobs |
194-
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
195-
| `ubuntu-24.04` | `security-fast`, manual CI dispatch and non-canonical repository fallbacks, pull-request retries of both UI E2E jobs, the QA Smoke aggregate, CodeQL security and quality scans, workflow-sanity, labeler, auto-response, the standalone Docs workflow, and the whole Install Smoke workflow |
196-
| `blacksmith-4vcpu-ubuntu-2404` | `preflight`, `pnpm-store-warmup`, `native-i18n`, `checks-fast-core` except QA Smoke CI, plugin/channel contract shards, most bundled/lower-weight Linux Node shards, `check-*` lanes except `check-lint`, selected `check-additional-*` shards, `check-docs`, and `skills-python` |
197-
| `blacksmith-8vcpu-ubuntu-2404` | Retained heavy Linux Node suites, first-attempt same-repo pull requests and pushes for the serial Chromium/Vite `checks-ui-e2e` lane (three Control UI shards plus one browser extension shard), boundary/extension-heavy `check-additional-*` shards, `check-sqlite-session-lifecycle`, and `android` |
198-
| `blacksmith-16vcpu-ubuntu-2404` | Automatic QA Smoke CI shards, first-attempt same-repo pull requests and pushes for `checks-ui-e2e-real-gateway`, `build-artifacts` in CI and Testbox, and `check-lint` (CPU-sensitive enough that 8 vCPU cost more than they saved) |
199-
| `blacksmith-8vcpu-windows-2025` | `checks-windows` |
200-
| `blacksmith-6vcpu-macos-15` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-15` |
201-
| `blacksmith-12vcpu-macos-26` | `macos-swift` and `ios-build` on `openclaw/openclaw`; forks fall back to `macos-26` |
193+
| Runner | Jobs |
194+
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
195+
| `ubuntu-24.04` | `security-fast`, manual CI dispatch and non-canonical repository fallbacks, pull-request retries of both UI E2E jobs, the QA Smoke aggregate, CodeQL security and quality scans, workflow-sanity, labeler, auto-response, the standalone Docs workflow, and the whole Install Smoke workflow |
196+
| `blacksmith-4vcpu-ubuntu-2404` | `preflight`, `pnpm-store-warmup`, `native-i18n`, `checks-fast-core` except QA Smoke CI, plugin/channel contract shards, most bundled/lower-weight Linux Node shards, `check-*` lanes except `check-lint`, selected `check-additional-*` shards, `check-docs`, and `skills-python` |
197+
| `blacksmith-8vcpu-ubuntu-2404` | Retained heavy Linux Node suites, compact-small queue-tail bins 2, 5, and 8, first-attempt same-repo pull requests and pushes for the serial Chromium/Vite `checks-ui-e2e` lane (three Control UI shards plus one browser extension shard), boundary/extension-heavy `check-additional-*` shards, `check-sqlite-session-lifecycle`, and `android` |
198+
| `blacksmith-16vcpu-ubuntu-2404` | Automatic QA Smoke CI shards, first-attempt same-repo pull requests and pushes for `checks-ui-e2e-real-gateway`, `build-artifacts` in CI and Testbox, and `check-lint` (CPU-sensitive enough that 8 vCPU cost more than they saved) |
199+
| `blacksmith-8vcpu-windows-2025` | `checks-windows` |
200+
| `blacksmith-6vcpu-macos-15` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-15` |
201+
| `blacksmith-12vcpu-macos-26` | `macos-swift` and `ios-build` on `openclaw/openclaw`; forks fall back to `macos-26` |
202202

203203
## Runner registration budget
204204

‎scripts/lib/ci-node-test-plan.mts‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ const COMPACT_NODE_TEST_JOB_SECONDS = 310;
165165
const COMPACT_NODE_TEST_JOB_GROUPS = 10;
166166
const COMPACT_TOOLING_NODE_TEST_GROUPS = 4;
167167
const COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES = 120;
168+
// Route measured queue-tail bins to existing 8-vCPU capacity after packing so
169+
// the planner keeps the same groups, coverage, and runner-registration count.
170+
const COMPACT_8VCPU_CHECK_NAMES = new Set([
171+
"checks-node-compact-small-2",
172+
"checks-node-compact-small-5",
173+
"checks-node-compact-small-8",
174+
]);
168175
const AUTO_REPLY_COMMANDS_STRIPES = 3;
169176
const AGENTS_CORE_RUNNER_CLI_STRIPES = 3;
170177
const UNIT_FAST_NODE_TEST_STRIPES = 2;
@@ -1764,11 +1771,18 @@ function createCompactNodeTestShardBundles(
17641771
}
17651772
const runnerClass = firstGroup.runner.includes("-8vcpu-") ? "large" : "small";
17661773
const distSuffix = firstGroup.requiresDist ? "-dist" : "";
1774+
const checkName = `checks-node-compact-${runnerClass}${distSuffix}-${index + 1}`;
1775+
const runner = COMPACT_8VCPU_CHECK_NAMES.has(checkName)
1776+
? DEFAULT_NODE_TEST_RUNNER
1777+
: firstGroup.runner;
1778+
for (const group of bin.groups) {
1779+
group.runner = runner;
1780+
}
17671781
compactJobs.push({
1768-
checkName: `checks-node-compact-${runnerClass}${distSuffix}-${index + 1}`,
1782+
checkName,
17691783
groups: bin.groups,
17701784
requiresDist: firstGroup.requiresDist,
1771-
runner: firstGroup.runner,
1785+
runner,
17721786
shardName: `compact-${runnerClass}${distSuffix}-${index + 1}`,
17731787
// Whole-config groups run entire suites; keep their generous timeout.
17741788
...(bin.hasWholeConfigGroup

‎test/scripts/ci-node-test-plan.test.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const PLUGIN_PRERELEASE_NPM_SPEC_TEST = "src/plugins/install.npm-spec.test.ts";
3535
const PLUGIN_NPM_INSTALL_SECURITY_SCAN_TEST =
3636
"src/plugins/npm-install-security-scan.release.test.ts";
3737
const DEFAULT_NODE_TEST_RUNNER = "blacksmith-8vcpu-ubuntu-2404";
38+
const BUNDLED_NODE_TEST_RUNNER = "blacksmith-4vcpu-ubuntu-2404";
3839
function listTestFiles(rootDir: string): string[] {
3940
const gitFiles = listGitTrackedFiles({ pathspecs: rootDir });
4041
expect(gitFiles).not.toBeNull();
@@ -323,10 +324,10 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
323324
.find((group) => group.shard_name === "agentic-control-plane-startup-health-runtime")?.env,
324325
).toEqual({ OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS: "60000" });
325326
const largeJobs = compact.filter(
326-
(shard) => shard.runner === DEFAULT_NODE_TEST_RUNNER && !shard.requiresDist,
327+
(shard) => !shard.requiresDist && shard.checkName.startsWith("checks-node-compact-large-"),
327328
);
328329
const smallJobs = compact.filter(
329-
(shard) => shard.runner !== DEFAULT_NODE_TEST_RUNNER && !shard.requiresDist,
330+
(shard) => !shard.requiresDist && shard.checkName.startsWith("checks-node-compact-small-"),
330331
);
331332
const distJobs = compact.filter((shard) => shard.requiresDist);
332333
expect(largeJobs).toHaveLength(7);
@@ -336,6 +337,21 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
336337
shard.groups.every((group) => !exclusiveGroupRe.test(group.shard_name)),
337338
);
338339
expect(regularSmallJobs).toHaveLength(10);
340+
const routed8VcpuCheckNames = [
341+
"checks-node-compact-small-2",
342+
"checks-node-compact-small-5",
343+
"checks-node-compact-small-8",
344+
];
345+
expect(
346+
regularSmallJobs
347+
.filter((shard) => shard.runner === DEFAULT_NODE_TEST_RUNNER)
348+
.map((shard) => shard.checkName),
349+
).toEqual(routed8VcpuCheckNames);
350+
expect(
351+
smallJobs
352+
.filter((shard) => !routed8VcpuCheckNames.includes(shard.checkName))
353+
.every((shard) => shard.runner === BUNDLED_NODE_TEST_RUNNER),
354+
).toBe(true);
339355
// The refreshed hosted medians give every regular bin one known tail
340356
// anchor. Stale hints paired two of these slow groups in each runner class.
341357
const largeTailAnchors = [

0 commit comments

Comments
 (0)