test: share Docker test-state wrapper

This commit is contained in:
Peter Steinberger
2026-04-28 18:47:41 +01:00
parent 4d82dc4fb4
commit 3f780bb27d
9 changed files with 64 additions and 28 deletions

View File

@@ -81,3 +81,19 @@ docker_e2e_build_or_reuse() {
build_args+=(-t "$image_name" -f "$dockerfile" "$context")
docker_build_run "$label-build" "${build_args[@]}"
}
docker_e2e_test_state_shell_b64() {
local label="${1:?missing test-state label}"
local scenario="${2:-empty}"
node "$ROOT_DIR/scripts/lib/openclaw-test-state.mjs" shell \
--label "$label" \
--scenario "$scenario" \
| base64 \
| tr -d '\n'
}
docker_e2e_test_state_function_b64() {
node "$ROOT_DIR/scripts/lib/openclaw-test-state.mjs" shell-function \
| base64 \
| tr -d '\n'
}

View File

@@ -177,6 +177,7 @@ const bundledPluginInstallUninstallLanes = Array.from(
{
estimateSeconds: 280,
resources: ["npm"],
stateScenario: "empty",
weight: 1,
},
),
@@ -253,6 +254,7 @@ export const mainLanes = [
{ resources: ["npm"], weight: 3 },
),
npmLane("doctor-switch", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:doctor-switch", {
stateScenario: "empty",
weight: 3,
}),
npmLane(
@@ -285,7 +287,9 @@ export const mainLanes = [
npmLane("plugin-update", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugin-update"),
serviceLane("config-reload", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:config-reload"),
...bundledScenarioLanes,
lane("openai-image-auth", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:openai-image-auth"),
lane("openai-image-auth", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:openai-image-auth", {
stateScenario: "empty",
}),
lane(
"crestodian-first-run",
"OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:crestodian-first-run",
@@ -484,6 +488,7 @@ const releasePathPackageUpdateCoreLanes = [
{ resources: ["service"], stateScenario: "empty", weight: 3 },
),
npmLane("doctor-switch", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:doctor-switch", {
stateScenario: "empty",
weight: 3,
}),
npmLane(