mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:50:42 +00:00
perf: speed up Docker aggregate smokes
This commit is contained in:
@@ -15,6 +15,7 @@ docker run --rm -e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$IMAGE_NAME" bash -lc '
|
||||
export npm_config_loglevel=error
|
||||
export npm_config_fund=false
|
||||
export npm_config_audit=false
|
||||
export OPENCLAW_DISABLE_BUNDLED_PLUGINS=1
|
||||
|
||||
# Stub systemd/loginctl so doctor + daemon flows work in Docker.
|
||||
export PATH="/tmp/openclaw-bin:$PATH"
|
||||
@@ -130,13 +131,14 @@ LOGINCTL
|
||||
local doctor_expected="$5"
|
||||
local install_log="/tmp/openclaw-doctor-switch-${name}-install.log"
|
||||
local doctor_log="/tmp/openclaw-doctor-switch-${name}-doctor.log"
|
||||
local command_timeout="${OPENCLAW_DOCKER_DOCTOR_SWITCH_COMMAND_TIMEOUT:-300s}"
|
||||
|
||||
echo "== Flow: $name =="
|
||||
home_dir=$(mktemp -d "/tmp/openclaw-switch-${name}.XXXXXX")
|
||||
export HOME="$home_dir"
|
||||
export USER="testuser"
|
||||
|
||||
if ! eval "$install_cmd" >"$install_log" 2>&1; then
|
||||
if ! timeout "$command_timeout" bash -c "$install_cmd" >"$install_log" 2>&1; then
|
||||
cat "$install_log"
|
||||
exit 1
|
||||
fi
|
||||
@@ -150,7 +152,7 @@ LOGINCTL
|
||||
fi
|
||||
assert_entrypoint "$unit_path" "$install_expected"
|
||||
|
||||
if ! eval "$doctor_cmd" >"$doctor_log" 2>&1; then
|
||||
if ! timeout "$command_timeout" bash -c "$doctor_cmd" >"$doctor_log" 2>&1; then
|
||||
cat "$doctor_log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -35,12 +35,25 @@ docker run --rm \
|
||||
bash -lc "set -euo pipefail
|
||||
entry=dist/index.mjs
|
||||
[ -f \"\$entry\" ] || entry=dist/index.js
|
||||
mock_port=44081
|
||||
export OPENCLAW_DOCKER_OPENAI_BASE_URL=\"http://127.0.0.1:\$mock_port/v1\"
|
||||
MOCK_PORT=\"\$mock_port\" node scripts/e2e/mock-openai-server.mjs >/tmp/mcp-channels-mock-openai.log 2>&1 &
|
||||
mock_pid=\$!
|
||||
for _ in \$(seq 1 80); do
|
||||
if node -e \"fetch('http://127.0.0.1:' + process.argv[1] + '/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\" \"\$mock_port\"; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
node -e \"fetch('http://127.0.0.1:' + process.argv[1] + '/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\" \"\$mock_port\"
|
||||
node --import tsx scripts/e2e/mcp-channels-seed.ts >/tmp/mcp-channels-seed.log
|
||||
node \"\$entry\" gateway --port $PORT --bind loopback --allow-unconfigured >/tmp/mcp-channels-gateway.log 2>&1 &
|
||||
gateway_pid=\$!
|
||||
cleanup_inner() {
|
||||
kill \"\$gateway_pid\" >/dev/null 2>&1 || true
|
||||
wait \"\$gateway_pid\" >/dev/null 2>&1 || true
|
||||
kill \"\$mock_pid\" >/dev/null 2>&1 || true
|
||||
wait \"\$mock_pid\" >/dev/null 2>&1 || true
|
||||
}
|
||||
dump_gateway_log_on_error() {
|
||||
status=\$?
|
||||
|
||||
Reference in New Issue
Block a user