diff --git a/scripts/e2e/doctor-install-switch-docker.sh b/scripts/e2e/doctor-install-switch-docker.sh index 3c932659b..d3e6c5557 100755 --- a/scripts/e2e/doctor-install-switch-docker.sh +++ b/scripts/e2e/doctor-install-switch-docker.sh @@ -64,14 +64,15 @@ if [[ "$*" == *"enable-linger"* ]]; then fi exit 0 LOGINCTL - chmod +x /tmp/clawdbot-bin/loginctl - - # Install the npm-global variant from the local /app source. - npm install -g --prefix /tmp/npm-prefix /app - - npm_bin="/tmp/npm-prefix/bin/clawdbot" - npm_entry="/tmp/npm-prefix/lib/node_modules/clawdbot/dist/entry.js" - git_entry="/app/dist/entry.js" + chmod +x /tmp/clawdbot-bin/loginctl + + # Install the npm-global variant from the local /app source. + pkg_tgz="$(npm pack --silent /app)" + npm install -g --prefix /tmp/npm-prefix "/app/$pkg_tgz" + + npm_bin="/tmp/npm-prefix/bin/clawdbot" + npm_entry="/tmp/npm-prefix/lib/node_modules/clawdbot/dist/entry.js" + git_entry="/app/dist/entry.js" assert_entrypoint() { local unit_path="$1" @@ -81,14 +82,16 @@ LOGINCTL if [ -z "$exec_line" ]; then echo "Missing ExecStart in $unit_path" exit 1 - fi - exec_line="${exec_line#ExecStart=}" - entrypoint=$(echo "$exec_line" | awk "{print \$2}") - if [ "$entrypoint" != "$expected" ]; then - echo "Expected entrypoint $expected, got $entrypoint" - exit 1 - fi - } + fi + exec_line="${exec_line#ExecStart=}" + entrypoint=$(echo "$exec_line" | awk "{print \$2}") + entrypoint="${entrypoint%\"}" + entrypoint="${entrypoint#\"}" + if [ "$entrypoint" != "$expected" ]; then + echo "Expected entrypoint $expected, got $entrypoint" + exit 1 + fi + } # Each flow: install service with one variant, run doctor from the other, # and verify ExecStart entrypoint switches accordingly. @@ -118,17 +121,17 @@ LOGINCTL assert_entrypoint "$unit_path" "$doctor_expected" } - run_flow \ - "npm-to-git" \ - "$npm_bin daemon install --force" \ - "$npm_entry" \ - "node $git_entry doctor --repair" \ - "$git_entry" + run_flow \ + "npm-to-git" \ + "$npm_bin daemon install --force" \ + "$npm_entry" \ + "node $git_entry doctor --repair --force" \ + "$git_entry" - run_flow \ - "git-to-npm" \ - "node $git_entry daemon install --force" \ - "$git_entry" \ - "$npm_bin doctor --repair" \ - "$npm_entry" + run_flow \ + "git-to-npm" \ + "node $git_entry daemon install --force" \ + "$git_entry" \ + "$npm_bin doctor --repair --force" \ + "$npm_entry" ' diff --git a/scripts/e2e/gateway-network-docker.sh b/scripts/e2e/gateway-network-docker.sh index 19822f4cd..8b971d3b3 100644 --- a/scripts/e2e/gateway-network-docker.sh +++ b/scripts/e2e/gateway-network-docker.sh @@ -99,17 +99,17 @@ ws.send( auth: { token }, }, }), -); -const connectRes = await onceFrame((o) => o?.type === \"res\" && o?.id === \"c1\"); -if (!connectRes.ok) throw new Error(`connect failed: ${connectRes.error?.message ?? \"unknown\"}`); - -ws.send(JSON.stringify({ type: \"req\", id: \"h1\", method: \"health\" })); -const healthRes = await onceFrame((o) => o?.type === \"res\" && o?.id === \"h1\", 10000); -if (!healthRes.ok) throw new Error(`health failed: ${healthRes.error?.message ?? \"unknown\"}`); -if (healthRes.payload?.ok !== true) throw new Error(\"unexpected health payload\"); - -ws.close(); -console.log(\"ok\"); + ); + const connectRes = await onceFrame((o) => o?.type === \"res\" && o?.id === \"c1\"); + if (!connectRes.ok) throw new Error(\"connect failed: \" + (connectRes.error?.message ?? \"unknown\")); + + ws.send(JSON.stringify({ type: \"req\", id: \"h1\", method: \"health\" })); + const healthRes = await onceFrame((o) => o?.type === \"res\" && o?.id === \"h1\", 10000); + if (!healthRes.ok) throw new Error(\"health failed: \" + (healthRes.error?.message ?? \"unknown\")); + if (healthRes.payload?.ok !== true) throw new Error(\"unexpected health payload\"); + + ws.close(); + console.log(\"ok\"); NODE" echo "OK" diff --git a/scripts/e2e/onboard-docker.sh b/scripts/e2e/onboard-docker.sh index 8618cff81..70e3a48b0 100755 --- a/scripts/e2e/onboard-docker.sh +++ b/scripts/e2e/onboard-docker.sh @@ -12,7 +12,7 @@ docker run --rm -t "$IMAGE_NAME" bash -lc ' set -euo pipefail trap "" PIPE export TERM=xterm-256color - ONBOARD_FLAGS="--flow quickstart --auth-choice skip --skip-providers --skip-skills --skip-daemon --skip-ui" + ONBOARD_FLAGS="--flow quickstart --auth-choice skip --skip-channels --skip-skills --skip-daemon --skip-ui" # Provide a minimal trash shim to avoid noisy "missing trash" logs in containers. export PATH="/tmp/clawdbot-bin:$PATH" @@ -135,7 +135,7 @@ TRASH } send_local_basic() { - # Choose local gateway, accept defaults, skip provider/skills/daemon, skip UI. + # Choose local gateway, accept defaults, skip channels/skills/daemon, skip UI. send $'"'"'\r'"'"' 0.5 } @@ -149,14 +149,14 @@ TRASH send_local_basic } - send_providers_flow() { - # Configure providers via configure wizard. + send_channels_flow() { + # Configure channels via configure wizard. send $'"'"'\r'"'"' 1.0 send "" 1.5 - # Provider mode (default Configure providers) + # Mode (default Configure channels) send $'"'"'\r'"'"' 0.8 send "" 1.0 - # Configure chat providers now? -> No + # Configure chat channels now? -> No send $'"'"'n\r'"'"' 0.6 } @@ -339,11 +339,11 @@ if (errors.length > 0) { NODE } - run_case_providers() { + run_case_channels() { local home_dir - home_dir="$(make_home providers)" - # Providers-only configure flow. - run_wizard_cmd providers "$home_dir" "node dist/index.js configure --section providers" send_providers_flow + home_dir="$(make_home channels)" + # Channels-only configure flow. + run_wizard_cmd channels "$home_dir" "node dist/index.js configure --section channels" send_channels_flow config_path="$HOME/.clawdbot/clawdbot.json" assert_file "$config_path" @@ -440,7 +440,7 @@ NODE run_case_local_basic run_case_remote_non_interactive run_case_reset - run_case_providers + run_case_channels run_case_skills '