ci(release): speed up focused release reruns

This commit is contained in:
Peter Steinberger
2026-05-05 02:28:22 +01:00
parent 0131343db8
commit c84b7cbffc
11 changed files with 378 additions and 105 deletions

View File

@@ -36,6 +36,7 @@ import {
CROSS_OS_DASHBOARD_FETCH_TIMEOUT_MS,
CROSS_OS_DASHBOARD_SMOKE_TIMEOUT_MS,
CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS,
CROSS_OS_COMMAND_HEARTBEAT_SECONDS,
isImmutableReleaseRef,
isRecoverableWindowsPackagedUpgradeSwapCleanupFailure,
isRecoverableWindowsPackagedUpgradeTimeoutError,
@@ -43,6 +44,7 @@ import {
normalizeRequestedRef,
normalizeWindowsCommandShimPath,
normalizeWindowsInstalledCliPath,
parseCrossOsSuiteFilter,
parseArgs,
packageHasScript,
readInstalledVersion,
@@ -97,6 +99,11 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
).toBeGreaterThanOrEqual(5 * 60 * 1000);
});
it("prints command heartbeats before long release commands hit job timeouts", () => {
expect(CROSS_OS_COMMAND_HEARTBEAT_SECONDS).toBeGreaterThan(0);
expect(CROSS_OS_COMMAND_HEARTBEAT_SECONDS).toBeLessThanOrEqual(60);
});
it("accepts OK agent output from the captured log when stdout is empty", () => {
const dir = mkdtempSync(join(tmpdir(), "openclaw-cross-os-agent-output-"));
try {
@@ -372,6 +379,56 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
);
});
it("filters the cross-OS runner matrix to a focused OS suite", () => {
const matrix = resolveRunnerMatrix({
mode: "both",
ref: "main",
suiteFilter: "windows/packaged-upgrade",
ubuntuRunner: "",
windowsRunner: "",
macosRunner: "",
varUbuntuRunner: "",
varWindowsRunner: "",
varMacosRunner: "",
});
expect(matrix.include).toEqual([
expect.objectContaining({
os_id: "windows",
suite: "packaged-upgrade",
lane: "upgrade",
}),
]);
});
it("filters the cross-OS runner matrix by suite across platforms", () => {
const matrix = resolveRunnerMatrix({
mode: "both",
ref: "main",
suiteFilter: "packaged-fresh",
ubuntuRunner: "",
windowsRunner: "",
macosRunner: "",
varUbuntuRunner: "",
varWindowsRunner: "",
varMacosRunner: "",
});
expect(matrix.include).toHaveLength(3);
expect(matrix.include.map((entry) => entry.os_id).toSorted()).toEqual([
"macos",
"ubuntu",
"windows",
]);
expect(matrix.include.every((entry) => entry.suite === "packaged-fresh")).toBe(true);
});
it("rejects unsupported cross-OS suite filter tokens", () => {
expect(() => parseCrossOsSuiteFilter("windows/nope")).toThrow(
/Unsupported cross_os_suite_filter/u,
);
});
it("can rebuild the Windows PATH with or without current-process entries", () => {
expect(buildWindowsPathBootstrapScript()).toContain("@($userPath, $machinePath, $env:Path)");
const persistedOnlyScript = buildWindowsPathBootstrapScript({

View File

@@ -10,6 +10,8 @@ describe("cross-OS release checks workflow", () => {
const workflow = readFileSync(WORKFLOW_PATH, "utf8");
expect(workflow).toContain(HARNESS);
expect(workflow).toContain("suite_filter:");
expect(workflow).toContain('--suite-filter "${INPUT_SUITE_FILTER}"');
expect(workflow).not.toContain('pnpm dlx "tsx@${TSX_VERSION}"');
});

View File

@@ -307,6 +307,7 @@ describe("package artifact reuse", () => {
expect(workflow).toContain("live_suite_filter:");
expect(workflow).toContain("validate_live_suite_filter:");
expect(workflow).toContain("LIVE_SUITE_FILTER: ${{ inputs.live_suite_filter }}");
expect(workflow).toContain("live-cache attempt ${attempt}/3");
expect(workflow).toContain(
"live_suite_filter '${LIVE_SUITE_FILTER}' does not match any runnable suite",
);
@@ -548,6 +549,10 @@ describe("package artifact reuse", () => {
);
expect(workflow).toContain("rerun_group:");
expect(workflow).toContain("live_suite_filter:");
expect(workflow).toContain("cross_os_suite_filter:");
expect(workflow).toContain(
"suite_filter: ${{ needs.resolve_target.outputs.cross_os_suite_filter }}",
);
expect(workflow).toContain(
"live_suite_filter: ${{ needs.resolve_target.outputs.live_suite_filter }}",
);
@@ -559,6 +564,7 @@ describe("package artifact reuse", () => {
);
expect(workflow).toContain("- live-e2e");
expect(workflow).toContain("- qa-live");
expect(workflow).toContain("QA release-check lanes are advisory");
});
it("detects Matrix fail-fast support for older release refs", () => {
@@ -654,6 +660,7 @@ describe("package artifact reuse", () => {
"child_rerun_group=all",
'-f rerun_group="$child_rerun_group"',
'args+=(-f live_suite_filter="$LIVE_SUITE_FILTER")',
'args+=(-f cross_os_suite_filter="$CROSS_OS_SUITE_FILTER")',
"cancel-in-progress: ${{ inputs.ref == 'main' && inputs.rerun_group == 'all' }}",
"gh run cancel",
"NORMAL_CI_RESULT: ${{ needs.normal_ci.result }}",
@@ -678,6 +685,8 @@ describe("package artifact reuse", () => {
);
expectTextToIncludeAll(fullReleaseDocs, [
"pre-publish candidate",
"cross_os_suite_filter",
"QA release-check lanes are advisory",
"silently skip that",
"Telegram package lane",
"| `npm-telegram` | Published-package Telegram E2E; requires `npm_telegram_package_spec`. |",