From 3ae650ea1bc05b845368184a66b52416e9a9c45a Mon Sep 17 00:00:00 2001 From: cfdaily Date: Fri, 5 Jun 2026 23:51:28 +0800 Subject: [PATCH] auto-sync: 2026-06-05 23:51:28 --- docs/test-guide.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/test-guide.md b/docs/test-guide.md index ec8cfa1..5401e36 100644 --- a/docs/test-guide.md +++ b/docs/test-guide.md @@ -44,17 +44,35 @@ pytest -m review # 审查/Rebuttal ## E2E 怎么跑 +### 场景测试(严格串行,一个一个来) + ```bash # 1. 确认 daemon 在线 pm2 list | grep sanguo-moziplus-v2 -# 2. 跑 E2E(串行场景,一个一个来) -RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_scenarios.py -v +# 2. 逐个跑场景测试(关键:一个完成再跑下一个) +RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_scenarios.py::TestS9RealAgentDispatch -v +# → 通过?跑下一个。失败?分析根因、修复、重跑当前,不跳过 -# 3. 场景全通过后,跑压力测试 +RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_scenarios.py::TestS10FullChain -v +# → 以此类推,逐个推进 + +# 或者一次跑全部(pytest 默认串行,但无法在失败时停下来分析) +RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_scenarios.py -v --exitfirst +# --exitfirst 遇到第一个失败就停,方便定位问题 +``` + +**串行原则**:一个 case 跑完 → 收集结果 → 根因分析(如有问题)→ 修复 → 重跑当前 → 通过后再跑下一个。用时间换可靠性。 + +### 压力测试(场景全通过后) + +```bash RUN_INTEGRATION=1 pytest tests/e2e/test_e2e_stress.py -v +``` -# 4. 跑完后检查是否有残留 +### 跑完后检查残留 + +```bash curl -s http://localhost:8083/api/projects | python3 -c " import sys, json projs = json.load(sys.stdin)