| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
【FIX】修复 nightly Feishu 误报与 web_ui conftest 全局污染 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !306 merge issue-fix into develop 【FIX】修复 nightly Feishu 误报与 web_ui conftest 全局污染 Created-by: AvadaKedavrua Commit-by: AvadaKedavrua;liujiawang Merged-by: ascend-robot Description: ## 修改原因 1. **#97 nightly Feishu 误报**:pytest 各 phase exit=1(collection/import 失败)但 JUnit 为空时,Feishu 仍显示 All passed / Passed: 0 | Failed: 0。 2. **#96 web_ui conftest 污染**:tests/regression/web_ui/conftest.py 在 import 时 sys.modules["tensor_cast"] = MagicMock(),xdist 全量收集时污染全局模块,触发 tensor_cast.__spec__ is not set。 3. **transformers 5.8.0**:deepseek_v4 重复注册导致 collection 失败。 --- ## 修改内容 ### Nightly 报告(#97) - FeishuReportInput / PhaseBreakdownEntry 结构化报告输入 - build_phase_breakdown()、resolve_first_error()、extract_pytest_log_snippet() 解析 phase log - Feishu payload 按 overall_exit + errors 判定状态,展示 per-phase breakdown 与 infra failure - 新增/更新 tests/regression/scripts/helpers/nightly/ 回归用例 ### Conftest 与 CI Gate(#96) - 移除 web_ui/conftest.py 模块级 sys.modules mock - is_config_path() 匹配 tests/**/conftest.py,conftest 变更触发全量回归 - 新增 tests/smoke/test_conftest_hygiene.py 守卫 ### 测试规范补强 - 新增 tests/helpers/junit_xml.py 共享 JUnit XML 构造 - 新增四 phase 全 infra failure 集成测 test_emit_report_four_phase_all_infra_failure ### 其他 - transformers 上限 <5.8.0 - pytest xdist 默认 --dist=worksteal(scripts/lib/common.sh 与各 run_*.sh) - 更新 tests/README.md / tests/SKILL.md / docs/design/ut_refactor.md --- ## 自验证 ### Nightly 工具链 UT collect-only 目的:确认新增/重构用例可被 pytest 正常收集,无 import 错误。 步骤: 1. 同步 CI 依赖: bash uv sync --frozen --group ci 2. 仅收集 nightly 回归用例: bash uv run pytest tests/regression/scripts/helpers/nightly/ --collect-only -q 结果: 85 tests collected in 0.04s ### Lint / 类型检查 目的:确认改动文件符合项目 ruff / mypy 要求。 步骤:对以下路径执行 MCP lint 与 type_check(explicit_package_bases=true): - scripts/helpers/nightly/*.py - tests/helpers/junit_xml.py - tests/regression/scripts/helpers/nightly/test_*.py 结果: ruff: clean mypy: clean (follow-imports=skip, explicit-package-bases) ### Conftest 卫生(#96 回归场景) 目的:验证 web_ui conftest 不再污染 tensor_cast.__spec__。 步骤: bash uv run pytest tests/smoke/test_conftest_hygiene.py -q 结果:该用例在 dfb66f0 提交中已添加;全量回归由用户在远端环境验证通过(见会话记录)。 See merge request: Ascend/msmodeling!306 | 21 天前 |