mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:50:43 +00:00
ci: shard package upgrade survivor baselines
This commit is contained in:
@@ -92,12 +92,14 @@ describe("package acceptance workflow", () => {
|
||||
expect(workflow).toContain("suite_profile:");
|
||||
expect(workflow).toContain("published_upgrade_survivor_baseline:");
|
||||
expect(workflow).toContain("published_upgrade_survivor_baselines:");
|
||||
expect(workflow).toContain("last-stable-4");
|
||||
expect(workflow).toContain("all-since-2026.4.23");
|
||||
expect(workflow).toContain("published_upgrade_survivor_scenarios:");
|
||||
expect(workflow).toContain("scripts/resolve-upgrade-survivor-baselines.mjs");
|
||||
expect(workflow).toContain("--history-count 6");
|
||||
expect(workflow).toContain("--include-version 2026.4.23");
|
||||
expect(workflow).toContain("--pre-date 2026-03-15T00:00:00Z");
|
||||
expect(workflow).toContain('"last-stable-"');
|
||||
expect(workflow).toContain('"all-since-"');
|
||||
expect(workflow).toContain("npm-onboard-channel-agent gateway-network config-reload");
|
||||
expect(workflow).toContain("npm-onboard-channel-agent doctor-switch");
|
||||
@@ -199,7 +201,7 @@ describe("package artifact reuse", () => {
|
||||
"OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPEC: ${{ inputs.published_upgrade_survivor_baseline }}",
|
||||
);
|
||||
expect(workflow).toContain(
|
||||
"OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS: ${{ inputs.published_upgrade_survivor_baselines }}",
|
||||
"OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS: ${{ matrix.group.published_upgrade_survivor_baselines || inputs.published_upgrade_survivor_baselines }}",
|
||||
);
|
||||
expect(workflow).toContain(
|
||||
"OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS: ${{ inputs.published_upgrade_survivor_scenarios }}",
|
||||
@@ -229,8 +231,13 @@ describe("package artifact reuse", () => {
|
||||
});
|
||||
expect(workflow).toContain("plan_docker_lane_groups:");
|
||||
expect(workflow).toContain("targeted_docker_lane_group_size:");
|
||||
expect(workflow).toContain("scripts/plan-targeted-docker-lane-groups.mjs");
|
||||
expect(workflow).toContain(
|
||||
"OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS: ${{ inputs.published_upgrade_survivor_baselines }}",
|
||||
);
|
||||
expect(workflow).toContain("Docker E2E targeted lanes (${{ matrix.group.label }})");
|
||||
expect(workflow).toContain("LANES: ${{ matrix.group.docker_lanes }}");
|
||||
expect(workflow).toContain("GROUP_LABEL: ${{ matrix.group.label }}");
|
||||
expect(workflow).toContain("DOCKER_E2E_LANES: ${{ matrix.group.docker_lanes }}");
|
||||
expect(workflow).toContain("name: docker-e2e-${{ steps.plan.outputs.artifact_suffix }}");
|
||||
expect(scheduler).toContain(
|
||||
@@ -530,7 +537,7 @@ describe("package artifact reuse", () => {
|
||||
"docker_lanes: doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor plugins-offline plugin-update",
|
||||
);
|
||||
expect(workflow).toContain(
|
||||
"published_upgrade_survivor_baselines: ${{ needs.resolve_target.outputs.run_release_soak == 'true' && 'all-since-2026.4.23' || '' }}",
|
||||
"published_upgrade_survivor_baselines: ${{ needs.resolve_target.outputs.run_release_soak == 'true' && 'last-stable-4 2026.4.23 2026.5.2 2026.4.15' || '' }}",
|
||||
);
|
||||
expect(workflow).toContain(
|
||||
"published_upgrade_survivor_scenarios: ${{ needs.resolve_target.outputs.run_release_soak == 'true' && 'reported-issues' || '' }}",
|
||||
|
||||
68
test/scripts/targeted-docker-lane-groups.test.ts
Normal file
68
test/scripts/targeted-docker-lane-groups.test.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { planTargetedDockerLaneGroups } from "../../scripts/plan-targeted-docker-lane-groups.mjs";
|
||||
|
||||
describe("scripts/plan-targeted-docker-lane-groups", () => {
|
||||
it("keeps normal targeted lanes grouped by the configured group size", () => {
|
||||
expect(
|
||||
planTargetedDockerLaneGroups({
|
||||
groupSize: 2,
|
||||
lanes: "doctor-switch update-channel-switch plugin-update",
|
||||
}),
|
||||
).toEqual([
|
||||
{
|
||||
docker_lanes: "doctor-switch update-channel-switch",
|
||||
label: "doctor-switch--update-channel-switch",
|
||||
},
|
||||
{ docker_lanes: "plugin-update", label: "plugin-update" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("shards published upgrade survivor by baseline while preserving surrounding lanes", () => {
|
||||
expect(
|
||||
planTargetedDockerLaneGroups({
|
||||
groupSize: 2,
|
||||
lanes:
|
||||
"doctor-switch update-channel-switch published-upgrade-survivor plugins-offline plugin-update",
|
||||
upgradeSurvivorBaselines:
|
||||
"openclaw@2026.5.3-1 openclaw@2026.5.3 openclaw@2026.5.2 openclaw@2026.4.23",
|
||||
}),
|
||||
).toEqual([
|
||||
{
|
||||
docker_lanes: "doctor-switch update-channel-switch",
|
||||
label: "doctor-switch--update-channel-switch",
|
||||
},
|
||||
{
|
||||
docker_lanes: "published-upgrade-survivor",
|
||||
label: "published-upgrade-survivor-2026.5.3-1",
|
||||
published_upgrade_survivor_baselines: "openclaw@2026.5.3-1",
|
||||
},
|
||||
{
|
||||
docker_lanes: "published-upgrade-survivor",
|
||||
label: "published-upgrade-survivor-2026.5.3",
|
||||
published_upgrade_survivor_baselines: "openclaw@2026.5.3",
|
||||
},
|
||||
{
|
||||
docker_lanes: "published-upgrade-survivor",
|
||||
label: "published-upgrade-survivor-2026.5.2",
|
||||
published_upgrade_survivor_baselines: "openclaw@2026.5.2",
|
||||
},
|
||||
{
|
||||
docker_lanes: "published-upgrade-survivor",
|
||||
label: "published-upgrade-survivor-2026.4.23",
|
||||
published_upgrade_survivor_baselines: "openclaw@2026.4.23",
|
||||
},
|
||||
{ docker_lanes: "plugins-offline plugin-update", label: "plugins-offline--plugin-update" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("leaves a single baseline on the normal logical lane", () => {
|
||||
expect(
|
||||
planTargetedDockerLaneGroups({
|
||||
lanes: "published-upgrade-survivor",
|
||||
upgradeSurvivorBaselines: "openclaw@2026.5.2",
|
||||
}),
|
||||
).toEqual([
|
||||
{ docker_lanes: "published-upgrade-survivor", label: "published-upgrade-survivor" },
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -115,6 +115,49 @@ describe("scripts/resolve-upgrade-survivor-baselines", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("resolves last-stable baselines to the latest stable published package versions", () => {
|
||||
const releases = (
|
||||
[
|
||||
["v2026.5.4-beta.1", "2026-05-05T00:00:00Z", true],
|
||||
["v2026.5.3-1", "2026-05-04T00:00:00Z"],
|
||||
["v2026.5.3", "2026-05-03T00:00:00Z"],
|
||||
["v2026.5.2", "2026-05-02T00:00:00Z"],
|
||||
["v2026.4.29", "2026-04-30T00:00:00Z"],
|
||||
["v2026.4.27", "2026-04-28T00:00:00Z"],
|
||||
["v2026.4.15", "2026-04-16T00:00:00Z"],
|
||||
] as const
|
||||
).map(([tagName, publishedAt, isPrerelease = false]) => ({
|
||||
isPrerelease,
|
||||
publishedAt,
|
||||
tagName,
|
||||
}));
|
||||
|
||||
withReleaseFixture(releases, (releasesFile) => {
|
||||
withJsonFixture(
|
||||
"versions.json",
|
||||
["2026.5.3-1", "2026.5.3", "2026.5.2", "2026.4.29", "2026.4.27", "2026.4.15"],
|
||||
(versionsFile) => {
|
||||
expect(
|
||||
resolveBaselines(
|
||||
new Map([
|
||||
["requested", "last-stable-4 2026.4.23 2026.5.2 2026.4.15"],
|
||||
["releases-json", releasesFile],
|
||||
["npm-versions-json", versionsFile],
|
||||
]),
|
||||
),
|
||||
).toEqual([
|
||||
"openclaw@2026.5.3-1",
|
||||
"openclaw@2026.5.3",
|
||||
"openclaw@2026.5.2",
|
||||
"openclaw@2026.4.29",
|
||||
"openclaw@2026.4.23",
|
||||
"openclaw@2026.4.15",
|
||||
]);
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("maps release-history anchors to npm-published package versions when GitHub tags have republish suffixes", () => {
|
||||
const releases = (
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user