Commit Graph

3 Commits

Author SHA1 Message Date
Hermes Agent
8608f1e738 chore: fix ruff F401 re-export + mypy type errors + smoke e2e path handling
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
- data/llm/__init__.py, tests/__init__.py: 改用显式 `X as X` re-export 满足 ruff F401
- data/llm/prompts.py: 移除未使用的 json import
- admin/routes/web_public.py: 修复 LLM 集成新增代码的 5 处 mypy 类型错误
  - escape() 参数显式 str() 转换
  - int() 参数显式 str() 转换避免 AnyStr 报错
  - risk_level 字面量类型注解
- scripts/score_range_fullchain_100_e2e.py: 修复 batch_json/csv 绝对路径导致 relative_to() 崩溃

验证: GAOKAO_SKIP_INSTALL=1 bash scripts/dev-verify.sh
=> 1330 passed, 3 skipped, coverage 90.44%, core 100%, all checks passed
2026-06-29 07:37:49 +08:00
Hermes Agent
e1fd92975b fix(tests): 修复 P1-4/P1-7 改动引发的 2 个测试失败
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
1. test_backup_workflow: JWT secret 从 'secret'(6字符) 改为 32+ 字符
   - 原因: P1-4 /health readiness 修复后,短 JWT → settings_valid=false → 503
   - backup smoke 脚本启动 admin 时 /health 返回 503 导致测试失败
   - 修复: 使用足够长的测试 JWT secret

2. test_score_range_fullchain_100_script: default_output_path 断言更新
   - 原因: P1-7 把产物路径从 reports/ 改为 /tmp/,但 default_output_path 函数仍指向旧路径
   - 修复: default_output_path 统一用 /tmp/ + 去掉日期后缀

验证: pytest 1306 passed, 3 skipped, 0 failed
2026-06-27 19:54:37 +08:00
Hermes Agent
2be2f586cf fix(test): P1-2/P1-7/P1-8 100-case E2E 脚本三项修复
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
P1-2 boundary smoke 假阳性:
- boundary 分支现在真正 POST /api/public/orders 验证是否被契约阻断
- 不再只做 review_start 就标 skipped

P1-7 dev-verify 覆写受控报告:
- 默认回归产物从 reports/ 改为 /tmp/
- dev-verify smoke 失败不再阻断核心门禁(pytest/ruff/mypy)
- .gitignore 加入 score_range_fullchain_100_* 防止误提交

P1-8 smoke 启动探针误连旧进程:
- 启动前 socket bind 检测端口是否已被占用
- 启动探针改为双条件: proc.poll() is None + /health 200
- 进程意外退出时立即 raise 而非继续等 health

附带: review_start_ok/token_review_start_ok 断言兼容新文案复核结果
2026-06-27 14:32:53 +08:00