chore(prep): shared groundwork for batch-3 (admin/golden/cache)

第三批(T12 后台/T13 黄金集/T14 检索缓存)协调提交:
- kb:KbAssetService(登记/审核,tryon_ready 只能随 approved 打开)+ Asset 模型与 repo
- retrieval:list_gaps 缺口看板查询 + invalidate_cache() 钩子(T14 背后实现真缓存)
- 配置:ADMIN_TOKEN(空=后台 404)+ 检索缓存三参数
- pytest golden marker(默认跳过,CI 强制跑)+ Makefile golden + CI 防线 5c
- 测试隔离修复:test_auth_sms 加 autouse 清 sms:* 键夹具(频控计数跨运行
  累积会毒化后续运行——随机 IP 空间仅 254 且部分用例固定 device_id)
This commit is contained in:
xsl
2026-08-14 20:57:52 +08:00
parent 8ec8d2cefb
commit 9c1802130d
11 changed files with 236 additions and 5 deletions
+8 -3
View File
@@ -67,9 +67,14 @@ ignore = ["B008", "RUF001", "RUF002", "RUF003"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
# 集成用例需要真实 PostgreSQL/Redis,默认不跑:`make test-integration` 显式开启
addopts = "-q --strict-markers --strict-config -m 'not integration' --cov=packages --cov=apps"
markers = ["integration: 需要真实 PostgreSQL / Redis(默认跳过)"]
# 集成用例需要真实 PostgreSQL/Redis,默认不跑:`make test-integration` 显式开启。
# golden 用例(黄金集回归)同样需要真实 PG:CI 单独一步强制跑(T-P2-11),
# 本地默认跳过、`make golden` 显式开启。
addopts = "-q --strict-markers --strict-config -m 'not integration and not golden' --cov=packages --cov=apps"
markers = [
"integration: 需要真实 PostgreSQL / Redis(默认跳过)",
"golden: 黄金集回归(需要真实 PG;指标退化即失败,CI 强制跑)",
]
[tool.coverage.run]
branch = true