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

@@ -161,6 +161,26 @@ describe("openclaw test state", () => {
);
});
it("creates upgrade survivor fixture state", async () => {
await withOpenClawTestState(
{
scenario: "upgrade-survivor",
},
async (state) => {
const config = JSON.parse(await fs.readFile(state.configPath, "utf8"));
expect(config).toMatchObject({
update: {
channel: "stable",
},
plugins: {
enabled: true,
allow: ["discord", "telegram", "whatsapp", "memory"],
},
});
},
);
});
it("keeps external-service env scoped to the fixture", async () => {
const previousPolicy = process.env.OPENCLAW_SERVICE_REPAIR_POLICY;

View File

@@ -10,6 +10,7 @@ export type OpenClawTestStateScenario =
| "empty"
| "minimal"
| "update-stable"
| "upgrade-survivor"
| "gateway-loopback"
| "external-service";
@@ -133,6 +134,33 @@ function scenarioConfig(options: OpenClawTestStateOptions): Record<string, unkno
plugins: {},
};
}
if (scenario === "upgrade-survivor") {
return {
update: {
channel: "stable",
},
gateway: {
port: options.gateway?.port ?? 18789,
bind: "loopback",
auth: {
mode: "token",
token: options.gateway?.token ?? "openclaw-test-token",
},
controlUi: {
enabled: false,
},
},
plugins: {
enabled: true,
allow: ["discord", "telegram", "whatsapp", "memory"],
entries: {
discord: { enabled: true },
telegram: { enabled: true },
whatsapp: { enabled: true },
},
},
};
}
if (scenario === "gateway-loopback") {
return {
gateway: {