Skip to content

v8.2.0 P0-11 CI test job exit 2 真正根治(.gitignore 误伤 presets.py)

Choose a tag to compare

@lza6 lza6 released this 05 Sep 22:01
· 176 commits to main since this release

v8.2.0 — P0-11 CI test job exit 2 真正根治(.gitignore 误伤 presets.py)

根因(经 v8.1.5-v8.1.9 五轮诊断定位)

.gitignore:109 规则 config/ 误伤 api/config/presets.py(Python 包路径含 config/ 段)。
CI clone 后 api/config/presets.py 不存在 → api/config/__init__.py:973 import 失败
→ conftest autouse _reset_settings_singleton 调 reset_settings()→Settings() 失败
→ 所有用例 setup 阶段 E → exit 2(本地全绿因 presets.py 在工作区,CI clone 缺失)。

诊断证据(v8.1.9 CI 日志)

  • python -c "import api.config" → ModuleNotFoundError: No module named 'api.config.presets'
    File api/config/__init__.py line 973: from .presets import ...
  • pytest --setup-show: SETUP F _reset_settings_singleton E(fixture setup 失败)

修复

  • .gitignore:109 config/ → /config/(只忽略顶层 config/ 不误伤 api/config/)
  • 提交 api/config/presets.py(3218 字节,P0-2 拆分产物,MODEL_PRESETS/ASPECT_RATIOS/
    apply_model/MAX_IMAGE_BYTES/MAX_PROMPT_LEN 常量,被 init.py:973 re-export)
  • ci.yml test step 还原简化(去诊断段,保留 tee+GITHUB_STEP_SUMMARY 强化输出)
  • 版本号 7 处对齐 bump 8.1.9 → 8.2.0(主版本升级=CI 根治里程碑)

验证(本地)

  • 全量单测 1739 passed / 覆盖率 82.87%+ 过 80% 门禁
  • ruff/mypy/frontend/landing 全绿
  • TestFrontendVersionConsistency 3 passed

回滚

.gitignore 改回 config/(会重新误伤);presets.py 可删(但 init.py 依赖)