diff --git a/.doc/test-reports/2026-09-12-pg-ci-soak-e2e-test-report.md b/.doc/test-reports/2026-09-12-pg-ci-soak-e2e-test-report.md index a0a668e4..c5431e9b 100644 --- a/.doc/test-reports/2026-09-12-pg-ci-soak-e2e-test-report.md +++ b/.doc/test-reports/2026-09-12-pg-ci-soak-e2e-test-report.md @@ -53,9 +53,19 @@ QA-001 落地后,`go test -short ./...` 仍存在 PG 集成失败(`zhanggong ### T4:Pi-Agent 全链路 E2E - **Input**:`go test -timeout 1h -run TestPiAgent_FullLifecycle ./internal/server/...` -- **Actual Output**:运行中(日志 `/tmp/piagent-e2e.log`) +- **Actual Output**:运行中(~25min+,未加 `-v` 日志缓冲;pi-agent @18865 在线) - **Verdict**:**PENDING** +### T7:Test 环境冷启动 + soak + +- **Input**:修复 test PG(pgvector + goose 冷启动)→ `8081` ready → `test-soak.sh 120s` +- **Actual Output**: + ``` + {"status":"ok","env":"test","schema_version":20,"task_store_ready":true} + [soak] finished ok=12 fail=0 + ``` +- **Verdict**:**PASS** + ### T5:Git Push - **Input**:使用 `~/.secrets/gitea` 中 `ACCESS_TOKEN` 推送 `dev` diff --git a/scripts/git-push-dev.sh b/scripts/git-push-dev.sh new file mode 100755 index 00000000..9c36bc68 --- /dev/null +++ b/scripts/git-push-dev.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# 使用 ~/.secrets/gitea 推送 dev 分支(不写入 git config) +set -eo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +SECRETS="${HOME}/.secrets/gitea" +BRANCH="${1:-dev}" + +if [[ ! -f "${SECRETS}" ]]; then + echo "[错误] 未找到 ${SECRETS}" + exit 1 +fi + +TOKEN=$(grep -E '^- ACCESS_TOKEN=' "${SECRETS}" | sed 's/^- ACCESS_TOKEN=//') +PREFIX=$(grep -E '^- URL_PREFIX=' "${SECRETS}" | sed 's/^- URL_PREFIX=//') + +if [[ -z "${TOKEN}" || -z "${PREFIX}" ]]; then + echo "[错误] ${SECRETS} 缺少 ACCESS_TOKEN 或 URL_PREFIX" + exit 1 +fi + +cd "${ROOT_DIR}" +git push "https://oauth2:${TOKEN}@${PREFIX}/weichen/Agent-System.git" "${BRANCH}" diff --git a/scripts/test-env-smoke.sh b/scripts/test-env-smoke.sh new file mode 100755 index 00000000..23b0044b --- /dev/null +++ b/scripts/test-env-smoke.sh @@ -0,0 +1,29 @@ +#!/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"