Skip to content

v8.1.5 P0-11 test job 输出强制可见(head/tail cat)

Choose a tag to compare

@lza6 lza6 released this 05 Sep 21:29
· 181 commits to main since this release

v8.1.5 — P0-11 test job 输出强制可见(重定向落盘 + head/tail cat)

根因

v8.1.4 用 tee 管道,但 Actions step 失败时 stdout 仍被吞(只 exit 2 无输出)。
bash -e 在 pytest 失败时中断,导致 tee 后的 cat/GITHUB_STEP_SUMMARY 不执行。

修复(强制输出可见,不改测试逻辑)

  • pytest > /tmp/pytest-unit.log 2>&1 || PYTEST_EXIT=�(失败不中断)
  • head -80 + tail -80 /tmp/pytest-unit.log 强制输出到 stdout(失败 traceback 立即可见)
  • 写 - exit � 保留真实退出码

目的

下次 CI 失败能在 step log 直接看 pytest stdout(哪个用例失败 + traceback),
无需本地复现。CI 与本地版本完全一致(pytest 9.1.1 + pytest-asyncio 1.4.0),
本地 1739 passed 全绿但 CI exit 2 疑 CI runner 特异,需可见输出才能确诊。

验证(本地)

  • 全量单测: 1739 passed / 0 failed / 1 skipped
  • 覆盖率门禁: 82.87%+ 过 80%
  • ruff/mypy/frontend/landing 全绿

回滚

ci.yml 去 head/tail cat + 恢复 tee;版本号可回退