同步 enhance/bridge/smoke/retire 模块、vendor 3.3.34、增强面板与 PRD 文档, Hub 接入 hub-routes-prd,含安装/经验/模块说明与 co-integration 运维脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# pchat Hub 冒烟测试(API 层)
|
||
set -euo pipefail
|
||
HUB="${PCHAT_HUB_URL:-http://127.0.0.1:13458}"
|
||
FAIL=0
|
||
|
||
check() {
|
||
local name="$1" url="$2"
|
||
if curl -sf "$url" >/dev/null; then
|
||
echo "OK $name"
|
||
else
|
||
echo "FAIL $name ($url)"
|
||
FAIL=$((FAIL+1))
|
||
fi
|
||
}
|
||
|
||
check "panel" "$HUB/"
|
||
check "state" "$HUB/api/state"
|
||
check "prd" "$HUB/api/prd/progress"
|
||
check "enhance-status" "$HUB/api/enhance/status"
|
||
check "enhance-diagnose" "$HUB/api/enhance/diagnose"
|
||
check "mode-check" "$HUB/api/mode/check"
|
||
check "templates" "$HUB/api/templates"
|
||
check "retire-check" "$HUB/api/retire/check"
|
||
|
||
# bridge dry
|
||
TOKEN=$(curl -sf -X POST "$HUB/api/new" -H 'Content-Type: application/json' -d '{"title":"smoke-bridge"}' | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))")
|
||
if [[ -n "$TOKEN" ]]; then
|
||
R=$(curl -sf -X POST "$HUB/api/bridge/sync" -H 'Content-Type: application/json' \
|
||
-d "{\"token\":\"$TOKEN\",\"content\":\"smoke test conclusion\"}")
|
||
echo "$R" | python3 -c "import sys,json; j=json.load(sys.stdin); print('OK bridge' if j.get('ok') else 'FAIL bridge')"
|
||
[[ $(echo "$R" | python3 -c "import sys,json; print(json.load(sys.stdin).get('ok'))") == "True" ]] || FAIL=$((FAIL+1))
|
||
else
|
||
echo "FAIL new session"
|
||
FAIL=$((FAIL+1))
|
||
fi
|
||
|
||
echo "--- fail=$FAIL"
|
||
exit $((FAIL>0?1:0))
|