test: add update migration package gate

This commit is contained in:
Peter Steinberger
2026-05-02 00:34:28 +01:00
parent 3f4ca7c53b
commit 682e05532d
16 changed files with 349 additions and 14 deletions

View File

@@ -352,11 +352,39 @@ describe("scripts/lib/docker-e2e-plan", () => {
"published-upgrade-survivor-2026.4.29",
"published-upgrade-survivor-2026.4.29-feishu-channel",
"published-upgrade-survivor-2026.4.29-bootstrap-persona",
"published-upgrade-survivor-2026.4.29-plugin-deps-cleanup",
"published-upgrade-survivor-2026.4.29-tilde-log-path",
"published-upgrade-survivor-2026.4.29-versioned-runtime-deps",
]);
});
it("expands update migration across baselines and cleanup scenarios", () => {
const plan = planFor({
selectedLaneNames: ["update-migration"],
upgradeSurvivorBaselines: "2026.4.29 2026.4.23",
upgradeSurvivorScenarios: "plugin-deps-cleanup",
});
expect(plan.lanes.map((lane) => lane.name)).toEqual([
"update-migration-2026.4.29-plugin-deps-cleanup",
"update-migration-2026.4.23-plugin-deps-cleanup",
]);
expect(plan.lanes).toEqual(
expect.arrayContaining([
expect.objectContaining({
command: expect.stringContaining("pnpm test:docker:update-migration"),
imageKind: "bare",
stateScenario: "upgrade-survivor",
}),
expect.objectContaining({
command: expect.stringContaining(
"OPENCLAW_UPGRADE_SURVIVOR_SCENARIO='plugin-deps-cleanup'",
),
}),
]),
);
});
it("plans a live-only selected lane without package e2e images", () => {
const plan = planFor({ selectedLaneNames: ["live-models"] });

View File

@@ -9,6 +9,7 @@ const PACKAGE_JSON = "package.json";
const RELEASE_CHECKS_WORKFLOW = ".github/workflows/openclaw-release-checks.yml";
const FULL_RELEASE_VALIDATION_WORKFLOW = ".github/workflows/full-release-validation.yml";
const QA_LIVE_TRANSPORTS_WORKFLOW = ".github/workflows/qa-live-transports-convex.yml";
const UPDATE_MIGRATION_WORKFLOW = ".github/workflows/update-migration.yml";
const UPGRADE_SURVIVOR_RUN_SCRIPT = "scripts/e2e/lib/upgrade-survivor/run.sh";
type WorkflowStep = {
@@ -94,6 +95,7 @@ describe("package acceptance workflow", () => {
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('"all-since-"');
expect(workflow).toContain("npm-onboard-channel-agent gateway-network config-reload");
expect(workflow).toContain("npm-onboard-channel-agent doctor-switch");
expect(workflow).toContain("update-channel-switch upgrade-survivor");
@@ -133,6 +135,22 @@ describe("package acceptance workflow", () => {
expect(workflow).toContain("Published upgrade survivor baselines:");
expect(workflow).toContain("Published upgrade survivor scenarios:");
});
it("keeps exhaustive update migration as a separate manual package gate", () => {
const workflow = readFileSync(UPDATE_MIGRATION_WORKFLOW, "utf8");
const packageWorkflow = readFileSync(PACKAGE_ACCEPTANCE_WORKFLOW, "utf8");
expect(workflow).toContain("name: Update Migration");
expect(workflow).toContain("uses: ./.github/workflows/package-acceptance.yml");
expect(workflow).toContain("source: ref");
expect(workflow).toContain("suite_profile: custom");
expect(workflow).toContain("docker_lanes: update-migration");
expect(workflow).toContain("default: all-since-2026.4.23");
expect(workflow).toContain("default: plugin-deps-cleanup");
expect(workflow).toContain("telegram_mode: none");
expect(workflow).toContain("secrets: inherit");
expect(packageWorkflow).toContain("published-upgrade-survivor/update-migration");
});
});
describe("package artifact reuse", () => {

View File

@@ -75,6 +75,46 @@ describe("scripts/resolve-upgrade-survivor-baselines", () => {
});
});
it("resolves all-since baselines to every stable published release at or after the requested version", () => {
const releases = (
[
["v2026.5.2", "2026-05-03T00:00:00Z"],
["v2026.4.30", "2026-05-01T00:00:00Z"],
["v2026.4.29", "2026-04-30T00:00:00Z"],
["v2026.4.23", "2026-04-23T00:00:00Z"],
["v2026.4.22", "2026-04-22T00:00:00Z"],
["v2026.4.31-beta.1", "2026-05-02T00:00:00Z", true],
] as const
).map(([tagName, publishedAt, isPrerelease = false]) => ({
isPrerelease,
publishedAt,
tagName,
}));
withReleaseFixture(releases, (releasesFile) => {
withJsonFixture(
"versions.json",
["2026.5.2", "2026.4.30", "2026.4.29", "2026.4.23", "2026.4.22"],
(versionsFile) => {
expect(
resolveBaselines(
new Map([
["requested", "all-since-2026.4.23"],
["releases-json", releasesFile],
["npm-versions-json", versionsFile],
]),
),
).toEqual([
"openclaw@2026.5.2",
"openclaw@2026.4.30",
"openclaw@2026.4.29",
"openclaw@2026.4.23",
]);
},
);
});
});
it("maps release-history anchors to npm-published package versions when GitHub tags have republish suffixes", () => {
const releases = (
[