Files
Agent-System/scripts/test-env-smoke.sh
T
weichenandCursor 9598705fc7 chore(ops): add test env smoke script and document test soak pass.
Provide git-push-dev helper, DEP-001 smoke checks for test compose, and update E2E/soak test report.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00

30 lines
942 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# DEP-001 起步:test 环境容器 smoke(ready / health / SPA 首页 / 静态资源)
set -euo pipefail
BASE_URL="${1:-http://127.0.0.1:8081}"
PI_AGENT_URL="${2:-http://127.0.0.1:18866}"
fail=0
check() {
local name="$1"
shift
if "$@"; then
echo "[PASS] ${name}"
else
echo "[FAIL] ${name}" >&2
fail=1
fi
}
check "test app /api/v1/ready" curl -fsS "${BASE_URL}/api/v1/ready" >/dev/null
check "test app /api/v1/health" curl -fsS "${BASE_URL}/api/v1/health" >/dev/null
check "test app SPA /" bash -c "curl -fsS '${BASE_URL}/' | grep -q 'id=\"root\"'"
check "test app deep link /projects" bash -c "code=\$(curl -fsS -o /dev/null -w '%{http_code}' '${BASE_URL}/projects'); [[ \"\${code}\" == '200' || \"\${code}\" == '404' ]]"
check "pi-agent /health" bash -c "curl -fsS '${PI_AGENT_URL}/health' | grep -q '\"ok\": true'"
if (( fail > 0 )); then
exit 1
fi
echo "[SUCCESS] test env smoke passed"