[CI] Add pytest failure log collection and persistence#7405
[CI] Add pytest failure log collection and persistence#7405EmmonsCurse merged 4 commits intoPaddlePaddle:developfrom
Conversation
|
/skip-ci ci_iluvatar |
|
Thanks for your contribution! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7405 +/- ##
==========================================
Coverage ? 73.29%
==========================================
Files ? 398
Lines ? 54950
Branches ? 8606
==========================================
Hits ? 40276
Misses ? 11983
Partials ? 2691
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CI报告基于以下代码生成(每15分钟更新): 任务总览
任务汇总
失败分析Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage - 测试断言被故意反转分类: 测试失败 | 置信度: 高 根因分析: 本 PR 的核心功能是在
关键日志: 修复建议:
|
a25fc58 to
154c203
Compare
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 AI Code Review |
2026-04-16 20:11 CST
📋 Review 摘要
PR 概述:为 CI 添加 pytest 失败用例日志收集与持久化能力,提升调试效率
变更范围:tests/conftest.py(pytest hook 新增)、scripts/coverage_run.sh(grep 排除规则)、测试文件禁用
影响面 Tag:CI
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🟡 建议 | scripts/coverage_run.sh:111 |
--exclude 选项放在位置参数之后,在 POSIXLY_CORRECT 环境下可能失效 |
| ❓ 疑问 | tests/conftest.py:22 |
serving_utils 顶层导入可能影响非 e2e 测试的 collection |
总体评价
PR 整体质量良好,pytest hook 实现正确,日志文件命名和 sanitize 逻辑合理,与 coverage_run.sh 的 --exclude 配合也完整。提出了两个小建议供参考,未发现阻塞性问题。
|
|
||
| echo ">>> grep error in ${isolated_log_dir}" | ||
| grep -Rni --color=auto "error" "${isolated_log_dir}" || true | ||
| grep -Rni --color=auto "error" "${isolated_log_dir}" --exclude="pytest_*_error.log" || true |
There was a problem hiding this comment.
🟡 建议 --exclude 选项建议放在位置参数(目录路径)之前
当前 --exclude 放在 "${isolated_log_dir}" 之后。虽然 GNU grep 默认接受这种写法,但若环境设置了 POSIXLY_CORRECT,选项在位置参数之后会被忽略,导致 pytest 错误日志未被排除,在 CI 输出中产生干扰信息。
建议调整为:
grep -Rni --color=auto --exclude="pytest_*_error.log" "error" "${isolated_log_dir}" || true| from typing import Any, Union | ||
|
|
||
| import pytest | ||
| from e2e.utils.serving_utils import ( # noqa: E402 |
There was a problem hiding this comment.
❓ 疑问 from e2e.utils.serving_utils import ... 提升为模块顶层导入是否有风险?
原来该导入位于文件中部(FDRunner 类定义之前),现在移至文件最顶部。conftest.py 作为 tests/ 目录的根 conftest,会被所有测试(包括单元测试如 tests/logger/、tests/scheduler/ 等)加载。若运行环境中 e2e.utils.serving_utils 模块不可导入(例如缺少依赖),会导致所有测试的 collection 阶段失败。
请确认这个导入在所有 CI 环境中都可用,或者考虑保持延迟导入(lazy import)策略——例如仅在 FDRunner.__init__ 中导入 clean_ports 等符号。
Motivation
Enhance CI debugging capability by collecting detailed pytest failure logs, reducing troubleshooting time for flaky or failed cases.
Modifications
FD_LOG_DIRtest_*.pyfor debugging and validationtest_Qwen3_30b_tp4.pydue to unstable executionUsage or Command
N/A
Accuracy Tests
N/A
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.