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

@@ -278,6 +278,11 @@ export const mainLanes = [
weight: 3,
},
),
npmLane("upgrade-survivor", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:upgrade-survivor", {
stateScenario: "upgrade-survivor",
timeoutMs: 20 * 60 * 1000,
weight: 3,
}),
lane("plugins", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugins", {
resources: ["npm", "service"],
stateScenario: "empty",
@@ -530,6 +535,11 @@ const releasePathPackageUpdateCoreLanes = [
weight: 3,
},
),
npmLane("upgrade-survivor", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:upgrade-survivor", {
stateScenario: "upgrade-survivor",
timeoutMs: 20 * 60 * 1000,
weight: 3,
}),
];
const primaryReleasePathChunks = {

View File

@@ -11,6 +11,7 @@ const SCENARIOS = new Set([
"empty",
"minimal",
"update-stable",
"upgrade-survivor",
"gateway-loopback",
"external-service",
]);
@@ -86,6 +87,135 @@ function scenarioConfig(scenario, options = {}) {
plugins: {},
};
}
if (scenario === "upgrade-survivor") {
return {
update: {
channel: "stable",
},
gateway: {
mode: "local",
port: Number(options.port || 18789),
bind: "loopback",
auth: {
mode: "token",
token: { source: "env", provider: "default", id: "GATEWAY_AUTH_TOKEN_REF" },
},
controlUi: {
enabled: false,
},
},
models: {
providers: {
openai: {
api: "openai-responses",
apiKey: { source: "env", provider: "default", id: "OPENAI_API_KEY" },
baseUrl: "https://api.openai.com/v1",
models: [],
},
},
},
agents: {
defaults: {
model: {
primary: "openai/gpt-4.1-mini",
},
contextTokens: 64000,
skills: ["memory"],
},
list: [
{
id: "main",
default: true,
name: "Main",
workspace: "~/workspace",
model: {
primary: "openai/gpt-4.1-mini",
},
thinkingDefault: "low",
skills: ["memory"],
contextTokens: 64000,
},
{
id: "ops",
name: "Ops",
workspace: "~/workspace/ops",
model: {
primary: "openai/gpt-4.1-mini",
},
fastModeDefault: true,
},
],
},
skills: {
allowBundled: ["memory", "openclaw-testing"],
limits: {
maxSkillsInPrompt: 8,
maxSkillsPromptChars: 30000,
},
},
plugins: {
enabled: true,
allow: ["discord", "telegram", "whatsapp", "memory"],
entries: {
discord: { enabled: true },
telegram: { enabled: true },
whatsapp: { enabled: true },
},
},
channels: {
discord: {
enabled: true,
token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN" },
dm: {
policy: "allowlist",
allowFrom: ["111111111111111111"],
},
groupPolicy: "allowlist",
guilds: {
"222222222222222222": {
slug: "survivor-guild",
channels: {
"333333333333333333": {
enabled: true,
requireMention: true,
tools: {
allow: ["message_send"],
deny: ["exec"],
},
},
},
},
},
threadBindings: {
enabled: true,
idleHours: 72,
},
},
telegram: {
enabled: true,
botToken: { source: "env", provider: "default", id: "TELEGRAM_BOT_TOKEN" },
dmPolicy: "allowlist",
allowFrom: ["123456789"],
groups: {
"-1001234567890": {
enabled: true,
requireMention: true,
},
},
},
whatsapp: {
enabled: true,
dmPolicy: "allowlist",
allowFrom: ["+15555550123"],
groups: {
"120363000000000000@g.us": {
systemPrompt: "Use the existing WhatsApp group prompt.",
},
},
},
},
};
}
if (scenario === "gateway-loopback") {
return {
gateway: {
@@ -216,7 +346,7 @@ export function renderShellFunction() {
local label="$raw_label"
local scenario="\${2:-empty}"
case "$scenario" in
empty|minimal|update-stable|gateway-loopback|external-service) ;;
empty|minimal|update-stable|upgrade-survivor|gateway-loopback|external-service) ;;
*)
echo "unknown OpenClaw test-state scenario: $scenario" >&2
return 1
@@ -257,6 +387,181 @@ OPENCLAW_TEST_STATE_JSON
},
"plugins": {}
}
OPENCLAW_TEST_STATE_JSON
;;
upgrade-survivor)
cat > "$OPENCLAW_CONFIG_PATH" <<'OPENCLAW_TEST_STATE_JSON'
{
"update": {
"channel": "stable"
},
"gateway": {
"mode": "local",
"port": 18789,
"bind": "loopback",
"auth": {
"mode": "token",
"token": {
"source": "env",
"provider": "default",
"id": "GATEWAY_AUTH_TOKEN_REF"
}
},
"controlUi": {
"enabled": false
}
},
"models": {
"providers": {
"openai": {
"api": "openai-responses",
"apiKey": {
"source": "env",
"provider": "default",
"id": "OPENAI_API_KEY"
},
"baseUrl": "https://api.openai.com/v1",
"models": []
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openai/gpt-4.1-mini"
},
"contextTokens": 64000,
"skills": [
"memory"
]
},
"list": [
{
"id": "main",
"default": true,
"name": "Main",
"workspace": "~/workspace",
"model": {
"primary": "openai/gpt-4.1-mini"
},
"thinkingDefault": "low",
"skills": [
"memory"
],
"contextTokens": 64000
},
{
"id": "ops",
"name": "Ops",
"workspace": "~/workspace/ops",
"model": {
"primary": "openai/gpt-4.1-mini"
},
"fastModeDefault": true
}
]
},
"skills": {
"allowBundled": [
"memory",
"openclaw-testing"
],
"limits": {
"maxSkillsInPrompt": 8,
"maxSkillsPromptChars": 30000
}
},
"plugins": {
"enabled": true,
"allow": [
"discord",
"telegram",
"whatsapp",
"memory"
],
"entries": {
"discord": {
"enabled": true
},
"telegram": {
"enabled": true
},
"whatsapp": {
"enabled": true
}
}
},
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "env",
"provider": "default",
"id": "DISCORD_BOT_TOKEN"
},
"dm": {
"policy": "allowlist",
"allowFrom": [
"111111111111111111"
]
},
"groupPolicy": "allowlist",
"guilds": {
"222222222222222222": {
"slug": "survivor-guild",
"channels": {
"333333333333333333": {
"enabled": true,
"requireMention": true,
"tools": {
"allow": [
"message_send"
],
"deny": [
"exec"
]
}
}
}
}
},
"threadBindings": {
"enabled": true,
"idleHours": 72
}
},
"telegram": {
"enabled": true,
"botToken": {
"source": "env",
"provider": "default",
"id": "TELEGRAM_BOT_TOKEN"
},
"dmPolicy": "allowlist",
"allowFrom": [
"123456789"
],
"groups": {
"-1001234567890": {
"enabled": true,
"requireMention": true
}
}
},
"whatsapp": {
"enabled": true,
"dmPolicy": "allowlist",
"allowFrom": [
"+15555550123"
],
"groups": {
"120363000000000000@g.us": {
"systemPrompt": "Use the existing WhatsApp group prompt."
}
}
}
}
}
OPENCLAW_TEST_STATE_JSON
;;
gateway-loopback)