mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(ci): start gateway for agent delete Docker smoke (#122714)
This commit is contained in:
@@ -30,28 +30,32 @@ run_logged agents-delete-shared-workspace docker_e2e_docker_cmd run --rm \
|
||||
set -euo pipefail
|
||||
source scripts/lib/openclaw-e2e-instance.sh
|
||||
|
||||
run_openclaw() {
|
||||
if command -v openclaw >/dev/null 2>&1; then
|
||||
openclaw "$@"
|
||||
return
|
||||
fi
|
||||
if [ -f /app/openclaw.mjs ]; then
|
||||
node /app/openclaw.mjs "$@"
|
||||
return
|
||||
fi
|
||||
echo "openclaw CLI not found in Docker image" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing OPENCLAW_TEST_STATE_SCRIPT_B64}"
|
||||
export SHARED_WORKSPACE="$HOME/workspace-shared"
|
||||
output_file="$HOME/delete.json"
|
||||
trap '\''rm -rf "$HOME"'\'' EXIT
|
||||
gateway_log="$HOME/gateway.log"
|
||||
gateway_pid=""
|
||||
|
||||
cleanup() {
|
||||
openclaw_e2e_terminate_gateways "${gateway_pid:-}"
|
||||
rm -rf "$HOME"
|
||||
}
|
||||
dump_logs_on_error() {
|
||||
local status=$?
|
||||
openclaw_e2e_print_log "$gateway_log" >&2
|
||||
exit "$status"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
trap dump_logs_on_error ERR
|
||||
|
||||
mkdir -p "$OPENCLAW_STATE_DIR" "$SHARED_WORKSPACE"
|
||||
node scripts/e2e/lib/fixture.mjs agents-delete-config
|
||||
|
||||
run_openclaw agents delete ops --force --json > "$output_file"
|
||||
entry="$(openclaw_e2e_resolve_entrypoint)"
|
||||
gateway_pid="$(openclaw_e2e_start_gateway "$entry" 18789 "$gateway_log")"
|
||||
openclaw_e2e_wait_gateway_ready "$gateway_pid" "$gateway_log" 300 18789
|
||||
|
||||
node "$entry" agents delete ops --force --json > "$output_file"
|
||||
|
||||
node scripts/e2e/lib/fixture.mjs agents-delete-assert "$output_file"
|
||||
'
|
||||
|
||||
@@ -65,6 +65,7 @@ function assertAgentsDeleteResult([outputPath]) {
|
||||
[parsed.workspace, process.env.SHARED_WORKSPACE, "workspace"],
|
||||
[parsed.workspaceRetained, true, "workspaceRetained"],
|
||||
[parsed.workspaceRetainedReason, "shared", "workspaceRetainedReason"],
|
||||
[parsed.transport, "gateway", "transport"],
|
||||
];
|
||||
for (const [actual, expected, label] of comparisons) {
|
||||
assert(actual === expected, `${label} mismatch: ${JSON.stringify(actual)}`);
|
||||
|
||||
Reference in New Issue
Block a user