test: add upgrade survivor package lane

This commit is contained in:
Peter Steinberger
2026-04-30 18:06:57 +01:00
parent 7969f1f07c
commit 7beebc9afc
14 changed files with 730 additions and 6 deletions

View File

@@ -174,6 +174,7 @@ describe("scripts/lib/docker-e2e-plan", () => {
"npm-onboard-channel-agent",
"doctor-switch",
"update-channel-switch",
"upgrade-survivor",
]);
expect(packageUpdateCore.lanes).toEqual(
expect.arrayContaining([
@@ -189,6 +190,10 @@ describe("scripts/lib/docker-e2e-plan", () => {
name: "update-channel-switch",
stateScenario: "update-stable",
}),
expect.objectContaining({
name: "upgrade-survivor",
stateScenario: "upgrade-survivor",
}),
]),
);
expect(pluginsRuntimePlugins.lanes.map((lane) => lane.name)).toEqual(["plugins"]);
@@ -394,6 +399,7 @@ describe("scripts/lib/docker-e2e-plan", () => {
"bundled-channel-setup-entry",
"bundled-plugin-install-uninstall-0",
"update-channel-switch",
"upgrade-survivor",
],
});
@@ -474,6 +480,10 @@ describe("scripts/lib/docker-e2e-plan", () => {
name: "update-channel-switch",
stateScenario: "update-stable",
}),
expect.objectContaining({
name: "upgrade-survivor",
stateScenario: "upgrade-survivor",
}),
]);
});

View File

@@ -109,6 +109,52 @@ describe("scripts/lib/openclaw-test-state", () => {
}
});
it("creates the upgrade survivor scenario", async () => {
const { stdout } = await execFileAsync(process.execPath, [
scriptPath,
"--",
"create",
"--label",
"upgrade-survivor",
"--scenario",
"upgrade-survivor",
"--json",
]);
const payload = JSON.parse(stdout);
try {
expect(payload.scenario).toBe("upgrade-survivor");
expect(payload.config).toMatchObject({
update: {
channel: "stable",
},
gateway: {
auth: {
token: {
id: "GATEWAY_AUTH_TOKEN_REF",
source: "env",
},
},
},
channels: {
discord: {
enabled: true,
dm: {
policy: "allowlist",
},
},
telegram: {
enabled: true,
},
whatsapp: {
enabled: true,
},
},
});
} finally {
await fs.rm(payload.root, { recursive: true, force: true });
}
});
it("renders a reusable Docker shell function", async () => {
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-test-state-function-"));
const snippetFile = path.join(tempRoot, "state-function.sh");

View File

@@ -41,6 +41,7 @@ describe("package acceptance workflow", () => {
expect(workflow).toContain("suite_profile:");
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");
expect(workflow).toContain("bundled-channel-deps-compat");
expect(workflow).toContain("plugins-offline plugin-update");
expect(workflow).toContain("include_release_path_suites=true");