生成日期:2026-11-01 | 模式:discovery-only(发现/跟踪) 本仓库的 tdd-orchestrator 定位为「发现 / 格式化 / 跟踪已有测试」,实际跑测试在开发机完成 (需 mvn / MySQL / 已配好的 Python 环境)。本沙箱负责发现、编目、规划与进度跟踪。 ⚠️ 测试目标环境:
http://cfc.iwintrue.com(远程测试环境)。本机跑测试只针对该环境,不指向本地后端 / 不指向生产。
| 来源 | 文件数 | 用例/方法 |
|---|---|---|
结构化用例 tests/test-cases/*.md |
9 | 678 |
Playwright tests/**/*.spec.js |
70 | 411 |
Python pytest(cfc-langgraph + tools/xaf_agent_hub) |
12 | 47 |
Java 后端 @Test(cfc-backend/src/test/java) |
182 | 1379 |
用户场景 tests/user-scenarios/*.md |
8 | 文件级 |
| 合计 | — | 2515 |
后端 Controller 共 357 个、handler 方法 1933,已覆盖仅 199(10.3%),未覆盖 271 个。
缺口 = 当前测试源中没有任何 handler 被命中的 Controller。这是发现出的真实缺口,非发明。
| 模块 | 未覆盖 | 总数 | 覆盖率 | 优先级 |
|---|---|---|---|---|
admin(运营后台) |
103 | 120 | 14% | P0 |
guide(规划师) |
14 | 19 | 26% | P1 |
family(家庭) |
8 | 15 | 47% | P1 |
mind(心理) |
6 | 8 | 25% | P2 |
assessment(测评) |
5 | 6 | 17% | P2 |
diet / recommendation / fatloss / task / wealth / user 等 |
各 3–5 | 0% | — | P2/P3 |
admin 占全部未覆盖的约 38%,且多为核心管理接口,补测收益最高。
cd cfc-backend
mvn -q -DskipTests compile
# 只跑不依赖 Spring 上下文 / 数据库的纯单测包
mvn test -Dtest='com.etotem.cfc.unit.**,com.etotem.cfc.util.**,com.etotem.cfc.common.**'
cd cfc-backend
mvn test -Dtest='com.etotem.cfc.integration.**'
# 全量(耗时较长,需完整基础设施):
mvn test
⚠️
cfc-langgraph(Python / FastAPI / LangGraph)部署在192.168.16.251(opencode.iwintrue.com)测试环境主机上,不在本机跑。其 pytest 通过opencode_sessions.junit(client=opencode-iwintrue)远程派发执行。 本沙箱只做发现/编目(扫描cfc-langgraph/tests仓库内容),不本地安装 venv / 不本地运行 langgraph 测试。 此前"langgraph 需本地 Python 3.14 venv"的判断已作废 —— 该服务在远程测试环境运行,本地无需配置其运行环境。
# 发现/编目(本地只读扫描,OK)
python <skill>/test_inventory.py --project d:/cfc
# 实际运行 langgraph pytest:经 opencode.iwintrue.com 远程会话派发(delegation_enabled=true)
# 由 tdd_orchestrate.py 的 --auto / --alloc-session 选 label=python / langgraph 路由到 junit 会话
项目 Playwright 配置默认已指向测试环境:
playwright.config.api.js→ baseURL 直接http://cfc.iwintrue.com(API 级 e2e)playwright.config.js(主) → 默认http://cfc.iwintrue.com(可用PW_BASE_URL覆盖)playwright.config.func.js/playwright.config.smoke.js→ 默认http://127.0.0.1:9082,跑测试环境需显式覆盖e2e_complete_test.py→BASE = http://cfc.iwintrue.com:80⚠️ 后台小程序 Web 版前端部署在
http://cfc.iwintrue.com/frontend(根路径/返回 404 白标,非 API 路径/frontend才是 SPA)。 因此:
- API 级 e2e(走
request上下文,不依赖前端)→ 直接对cfc.iwintrue.com跑(已验证)。- UI 级 e2e(依赖
page.goto/DOM)→ baseURL 须指向http://cfc.iwintrue.com/frontend,否则会因根路径 404 而全部失败。UI 用例可在本沙箱直接用已装 chromium 跑(不依赖 opencode);也可经 opencode 派发到 189/本机跑(见 3.5)。
cd tests
npm install
npx playwright install chromium
# 针对测试环境(func/smoke 需带 PW_BASE_URL;api/主配置默认即是)
PW_BASE_URL=http://cfc.iwintrue.com npx playwright test --project=api # API 级 e2e(默认指向测试环境)
PW_BASE_URL=http://cfc.iwintrue.com npx playwright test --project=smoke # 冒烟(覆盖 localhost 默认)
PW_BASE_URL=http://cfc.iwintrue.com npx playwright test --project=func # 功能(覆盖 localhost 默认)
PW_BASE_URL=http://cfc.iwintrue.com npx playwright test # 全量
# UI 级 e2e 针对小程序前端(baseURL 指向 /frontend)
PW_BASE_URL=http://cfc.iwintrue.com/frontend npx playwright test --project=desktop # 桌面端 UI(如有)
# Python 端到端(已硬编码 cfc.iwintrue.com:80)
python e2e_complete_test.py
后台小程序的 Web 自动化测试在
192.168.16.189:4090(189)与localhost:4091(本机)两台 opencode 会话上派发执行,均针对http://cfc.iwintrue.com/frontend。
opencode_sessions.testing(client=web-4091)→ 项目目录d:/cfc(本机)opencode_sessions.production(client=web-189-4090)→ 项目目录c:/code/cfc(189)- 并发约束:
agent_session_limit=1(每台 Web 自动化服务器同时最多 1 个会话,含跨项目)。⚠️ 当前执行阻塞(R8):三台 opencode 共用
AgnesAILLM 配额已耗尽(429),agent 无法完成工具循环,故经 opencode 派发的小程序 Web 自动化暂时跑不起来。 替代方案:UI 级 e2e 可直接在本沙箱用 Playwright + chromium 对cfc.iwintrue.com/frontend跑(见 3.4),不依赖 opencode 配额。待 R8 解除后,opencode 派发即可恢复。
opencode.iwintrue.com 会话派发(label=python/langgraph),不在本机跑。cfc.iwintrue.com 测试环境跑(见 3.4,func/smoke 带 PW_BASE_URL)。.tdd/test-progress.json,按 anchor = source_path#local_id 索引(如 tests/test-cases/admin.md#TC-A-01)。test_inventory.py 即从侧车派生 docs/tdd/test/automation-status.md。.md / .spec.js / .py / .java。发现 / 台账命令(只读):
python <skill>/discover_tests.py --project d:/cfc
python <skill>/test_inventory.py --project d:/cfc
<skill> = C:/Users/iwt/.workbuddy/skills/tdd-orchestrator/scripts
admin 模块(103 未覆盖,核心管理接口),再 guide / family / mind / assessment。通过 / 失败 / 阻塞),再跑 test_inventory.py 刷新共享台账。http://cfc.iwintrue.com 测试环境;Java 单测为本地代码层验证,集成测试连测试环境基础设施。.tdd/;docs/tdd/test/*.md 可提交推送给测试团队。