| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
【REFACTOR】CI Gate 联合执行与 Nightly 流水线加固 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !342 merge fix into develop 【REFACTOR】CI Gate 联合执行与 Nightly 流水线加固 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 CI Gate / Nightly helpers 在 union 重构后存在多处逻辑与体验问题: - 全豁免测试仍跑 Phase 2(#112) - Nightly audit 使用过期 test_map(#113) - coverage fallback 在 union 重构后断裂(#119) - PRODUCT_SOURCE_PREFIXES 与 gate_policy.yaml 双源 roots - 重复 collect/git diff、日志含内部术语、nightly 缺终端摘要 本 PR 统一执行模型并补齐回归测试与文档。 --- ## 修改内容 **CI Gate (scripts/helpers/ci_gate/)** - 预跑硬阻断仅保留删除测试/删除源码;覆盖率映射改为跑后软策略 - compute_execution_plan 联合去重 pytest waves;产品/测试变更时附加 --cov - fetch_diff() 单次 git diff;load_gate_policy 按 yaml mtime 缓存 - roots 单一来源:tests/.ci/gate_policy.yaml - 用户向英文日志与成功摘要 print **Nightly (scripts/helpers/nightly/)** - 过期/冗余审计使用新鲜 test_map(#113) - 终端摘要、英文 phase 标签;移除 drift TODO - allowed_node_ids 复用、弱覆盖符号检测传 mapping **Common / Policy** - coverage_config.py 懒加载 product_roots() - gate_policy.yaml:tests/helpers/** exclude - 文档同步:tests/README.md、docs/design/ut_refactor.md、tests/SKILL.md 关联 issue:#112 #113 #114 #115 #116 #117 #119 #120 #121 #122 #123 #124 --- ## 优化特性对比(Before / After) ### 特性 1:联合去重 pytest 执行(核心优化) **场景**:同一 PR 同时改了产品代码 tensor_cast/foo.py 和测试文件 tests/regression/cli/test_shared.py,且 test_shared.py::test_x 恰好也是 foo.py 在 test_map 里的回归用例。 #### Before(分阶段、可能重复跑) text # 1) 预跑:新源码无 test_map 映射 → 直接硬阻断,pytest 还没跑 BLOCK: tensor_cast/foo.py has no test_map entry for symbol Foo.bar # 2) Phase 0:单独跑一轮带 --cov 的 pytest 做 coverage fallback pytest tests/regression/cli/test_shared.py -m not npu --cov ... # 3) Phase 1:跑变更测试 pytest tests/regression/cli/test_shared.py::test_x -m not npu # 4) Phase 2:再跑映射回归(与 Phase 1 重叠) pytest tests/regression/cli/test_shared.py::test_x \ tests/regression/cli/test_other.py::test_y \ -m "not npu and not nightly and not network" → test_shared.py::test_x 被执行 2~3 次;git diff 可能重复 fetch;coverage 与映射校验割裂 #### After(先跑、后验、去重) text # 1) 预跑硬阻断:仅删测试 / 删源码 Validating hard-blocking policy ... (no block — foo.py 是修改不是删除) # 2) 计划:联合调度,node id 去重(changed-test 优先) Scheduling 2 test node(s): new or changed test file Scheduling 1 test node(s): changed product file mapped regression Sample node(s): tests/regression/cli/test_shared.py::test_x, ... Execution uses 2 pytest wave(s) after deduplication # 3) 单次 union pytest(附带 --cov --cov-context=test) Wave 1 (-m not npu): tests/regression/cli/test_shared.py::test_x # changed-test,只跑一次 Wave 2 (-m not npu and not nightly and not network): tests/regression/cli/test_other.py::test_y # 纯回归,test_x 不再重复 # 4) 跑后软策略:用同一次 .coverage 做 mapping fallback Checking new/modified source coverage mapping against collected data ... CI gate passed: 2 test node(s) (new or changed test file; changed product file mapped regression) → 同一 node 只执行 1 次;coverage fallback 与 pytest 同轮完成;CI 耗时更短、行为更可预期 ### 特性 2:配置变更触发全量,跳过无效 collect **场景**:PR 只改了 pyproject.toml(依赖/测试配置变更)。 #### Before text config change detected → full suite still collect changed test files in Phase 1 ... # 多余 collect pytest tests/ -m not npu #### After text Config path(s): pyproject.toml Selected full test suite: dependency or test configuration changed pytest tests/ -m not npu # changed_test_nodes 为空,跳过 gate_new_tests collect CI gate passed: full test suite (pyproject.toml) ### 特性 3:Nightly 终端摘要(用户可读) #### Before text Phase 2a done. elapsed=1832.4s # 流水线结束,无一行总览;内部 phase 编号 #### After text Nightly pipeline finished. test_map: written (line 74.1%, branch 61.8%) nightly-marked: 142 passed in 1832s benchmark: 38 passed in 412s network: 12 passed in 89s weak coverage symbols: 3 report: /path/to/nightly_report.json --- ## 自验证 ### Helpers 回归测试 目的:确认 CI Gate / Nightly / Common helpers 全量回归通过 步骤: 1. 进入仓库根目录 2. 执行: bash uv run python -m pytest tests/regression/scripts/helpers/ -q 结果: 341 passed, 5 warnings in 1.02s ### gate_policy 缓存失效 目的:确认 yaml mtime 变化后 load_gate_policy 缓存失效 步骤: 1. 运行单测: bash uv run python -m pytest tests/regression/scripts/helpers/ci_gate/test_gate_policy.py::test_load_gate_policy_cached_until_yaml_mtime_changes -v 结果:PASSED(修复同秒写入 mtime 未变导致的 flaky) ### pre-commit 目的:提交前 hook 全绿 步骤: 1. git commit 触发 pre-commit(ruff、pylint、bandit、typos 等) 结果:全部 Passed See merge request: Ascend/msmodeling!342 | 13 天前 | |
【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 | 18 天前 | |
【FIX】【TEST】修复 README/文档失效链接并默认运行完整 benchmark 套件 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !331 merge fix into develop 【FIX】【TEST】修复 README/文档失效链接并默认运行完整 benchmark 套件 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 1. README.md 社区区公众号二维码指向 msinsight 仓库旧路径,资源已 404,用户扫码/预览失败。 2. OP_PLUGIN_MAPPING_TUTORIAL.md 中 Op Mapping skill 相对路径错误,文档内链接跳转失败。 3. benchmark 入口默认只跑 tests/benchmark/ops/,tests/benchmark/models/ 模型回归被静默跳过,CI/nightly 覆盖不足。 4. 全量 benchmark 启用后,qwen3-30b-a3b decode/prefill baseline 与当前 compile 输出不一致,需刷新。 --- ## 修改内容 | 类别 | 文件 | 变更 | |------|------|------| | 文档链接 | README.md | 公众号图片 URL 换为可用 user-images 资源;TOC 补全 Contributions / Community 等章节锚点 | | 文档链接 | docs/perf_database/tutorial/OP_PLUGIN_MAPPING_TUTORIAL.md | skill 路径 ../skills/... → ../../../.agents/skills/op-mapping/SKILL.md | | benchmark 默认行为 | scripts/run_benchmark.sh、scripts/helpers/nightly/main.py | 移除 MSMODELING_BENCHMARK_MODELS 开关,固定跑 tests/benchmark/ 全目录 | | 设计文档 | docs/design/ut_refactor.md | 同步 benchmark phase 描述 | | baseline | tests/benchmark/models/cases/qwen3-30b-a3b-{decode,prefill}.json | 刷新 baseline_time_s 与 operator top-N | | lint | experimental/optix/、scripts/、tensor_cast/、tests/ 等 | 为 inspect.* 误报补 pylint: disable 注释 | --- ## 自验证 ### README 公众号图片链接 目的:确认旧链接 404、新链接可访问。 步骤: 1. 检查旧 URL HTTP 状态 2. 检查新 URL HTTP 状态 bash curl -sI "https://raw.gitcode.com/Ascend/msinsight/raw/master/docs/zh/user_guide/figures/readme/officialAccount.jpg" | head -1 curl -sI "https://raw.gitcode.com/user-images/assets/8428112/2a22a707-de26-4bb3-b312-4952035e021b/30be980e7fd65b2486d251b48a7999f3.jpg" | head -1 结果: text HTTP/1.1 404 Not Found HTTP/1.1 200 OK ### Op Mapping skill 文档路径 目的:确认教程内链接指向真实文件。 步骤: 1. 在仓库根目录检查 skill 文件是否存在 bash test -f .agents/skills/op-mapping/SKILL.md && echo OK 结果: text OK ### Benchmark 入口默认全量 目的:确认 run_benchmark.sh 不再依赖 MSMODELING_BENCHMARK_MODELS,默认覆盖 models 子目录。 步骤: 1. 查看脚本 benchmark target 配置 bash grep -n "TESTS_BENCHMARK" scripts/run_benchmark.sh 结果: text run_pytest "${TESTS_BENCHMARK}/" \ ### CI 流水线 目的:确认改动未破坏现有 CI/docs CI。 步骤: 1. 查看 PR #331 CI label 状态 结果:PR 已打标 ci-pipeline-passed、docs-ci-pipeline-success。 See merge request: Ascend/msmodeling!331 | 14 天前 | |
【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !334 merge fix into develop 【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 背景 修复 CI 增量门禁多处漏检/误拦(含 #107):Phase 0 test_map 合并覆盖同 symbol、未映射 symbol 误拦、pytest 继承 addopts 行为不可控、exemptions.tests 整文件误豁免等。 Closes #107 --- ## 改动摘要 ### 策略与 coverage - **_merge_test_maps**:同 symbol test id **union**,不再 replace(修复 test_main_extra 等用例被跳过) - **coverage 兜底**:symbol 双 map 均无 → 查 Phase 0 .coverage(含 import 空 context)→ 放行 - **omit SSOT**:读 pyproject.toml [tool.coverage.run].omit;gate_policy.yaml 新增 roots,exemptions.tests 接入 Phase 0/2 ### Pytest 执行(pytest_runner.py) - 门禁 subprocess 统一 **-o addopts=** + **显式 -m** - **collect-first** → min(cpu, collected) + --dist worksteal - Phase 0: not npu;Phase 1/2 增量: not npu and not nightly and not network;config 全量: tests/ + not npu - 全量触发:conftest.py、requirements.txt、uv.lock 等;**不含** gate_policy.yaml ### exemptions.tests(node 级) - 登记必须为 pytest node(tests/...py::func 或 ...::Class::method),禁止 [、禁止 class-only、禁止整文件 pathspec 回退 - **Phase 0**:按改动文件 collect node → 过滤豁免 → 显式 node 列表跑 pytest+cov;全豁免打 log 跳过(避免 exit 5) - **Phase 2**:incremental_tests 过滤豁免 node - Phase 0 失败输出可复制 exemptions.tests YAML 模板 ### 可观测性 - Phase 0/1/2 及策略拦截日志:说明各阶段目的、失败含义、跳过原因 - run_*.sh:-vv;nested subprocess+cov+xdist 回归测试改 stub --- ## 自验证 bash uv run pytest tests/regression/scripts/helpers/ci_gate/ \ tests/regression/scripts/helpers/common/test_pytest_runner.py -q 141 passed See merge request: Ascend/msmodeling!334 | 13 天前 | |
【REFACTOR】CI Gate 联合执行与 Nightly 流水线加固 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !342 merge fix into develop 【REFACTOR】CI Gate 联合执行与 Nightly 流水线加固 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 修改原因 CI Gate / Nightly helpers 在 union 重构后存在多处逻辑与体验问题: - 全豁免测试仍跑 Phase 2(#112) - Nightly audit 使用过期 test_map(#113) - coverage fallback 在 union 重构后断裂(#119) - PRODUCT_SOURCE_PREFIXES 与 gate_policy.yaml 双源 roots - 重复 collect/git diff、日志含内部术语、nightly 缺终端摘要 本 PR 统一执行模型并补齐回归测试与文档。 --- ## 修改内容 **CI Gate (scripts/helpers/ci_gate/)** - 预跑硬阻断仅保留删除测试/删除源码;覆盖率映射改为跑后软策略 - compute_execution_plan 联合去重 pytest waves;产品/测试变更时附加 --cov - fetch_diff() 单次 git diff;load_gate_policy 按 yaml mtime 缓存 - roots 单一来源:tests/.ci/gate_policy.yaml - 用户向英文日志与成功摘要 print **Nightly (scripts/helpers/nightly/)** - 过期/冗余审计使用新鲜 test_map(#113) - 终端摘要、英文 phase 标签;移除 drift TODO - allowed_node_ids 复用、弱覆盖符号检测传 mapping **Common / Policy** - coverage_config.py 懒加载 product_roots() - gate_policy.yaml:tests/helpers/** exclude - 文档同步:tests/README.md、docs/design/ut_refactor.md、tests/SKILL.md 关联 issue:#112 #113 #114 #115 #116 #117 #119 #120 #121 #122 #123 #124 --- ## 优化特性对比(Before / After) ### 特性 1:联合去重 pytest 执行(核心优化) **场景**:同一 PR 同时改了产品代码 tensor_cast/foo.py 和测试文件 tests/regression/cli/test_shared.py,且 test_shared.py::test_x 恰好也是 foo.py 在 test_map 里的回归用例。 #### Before(分阶段、可能重复跑) text # 1) 预跑:新源码无 test_map 映射 → 直接硬阻断,pytest 还没跑 BLOCK: tensor_cast/foo.py has no test_map entry for symbol Foo.bar # 2) Phase 0:单独跑一轮带 --cov 的 pytest 做 coverage fallback pytest tests/regression/cli/test_shared.py -m not npu --cov ... # 3) Phase 1:跑变更测试 pytest tests/regression/cli/test_shared.py::test_x -m not npu # 4) Phase 2:再跑映射回归(与 Phase 1 重叠) pytest tests/regression/cli/test_shared.py::test_x \ tests/regression/cli/test_other.py::test_y \ -m "not npu and not nightly and not network" → test_shared.py::test_x 被执行 2~3 次;git diff 可能重复 fetch;coverage 与映射校验割裂 #### After(先跑、后验、去重) text # 1) 预跑硬阻断:仅删测试 / 删源码 Validating hard-blocking policy ... (no block — foo.py 是修改不是删除) # 2) 计划:联合调度,node id 去重(changed-test 优先) Scheduling 2 test node(s): new or changed test file Scheduling 1 test node(s): changed product file mapped regression Sample node(s): tests/regression/cli/test_shared.py::test_x, ... Execution uses 2 pytest wave(s) after deduplication # 3) 单次 union pytest(附带 --cov --cov-context=test) Wave 1 (-m not npu): tests/regression/cli/test_shared.py::test_x # changed-test,只跑一次 Wave 2 (-m not npu and not nightly and not network): tests/regression/cli/test_other.py::test_y # 纯回归,test_x 不再重复 # 4) 跑后软策略:用同一次 .coverage 做 mapping fallback Checking new/modified source coverage mapping against collected data ... CI gate passed: 2 test node(s) (new or changed test file; changed product file mapped regression) → 同一 node 只执行 1 次;coverage fallback 与 pytest 同轮完成;CI 耗时更短、行为更可预期 ### 特性 2:配置变更触发全量,跳过无效 collect **场景**:PR 只改了 pyproject.toml(依赖/测试配置变更)。 #### Before text config change detected → full suite still collect changed test files in Phase 1 ... # 多余 collect pytest tests/ -m not npu #### After text Config path(s): pyproject.toml Selected full test suite: dependency or test configuration changed pytest tests/ -m not npu # changed_test_nodes 为空,跳过 gate_new_tests collect CI gate passed: full test suite (pyproject.toml) ### 特性 3:Nightly 终端摘要(用户可读) #### Before text Phase 2a done. elapsed=1832.4s # 流水线结束,无一行总览;内部 phase 编号 #### After text Nightly pipeline finished. test_map: written (line 74.1%, branch 61.8%) nightly-marked: 142 passed in 1832s benchmark: 38 passed in 412s network: 12 passed in 89s weak coverage symbols: 3 report: /path/to/nightly_report.json --- ## 自验证 ### Helpers 回归测试 目的:确认 CI Gate / Nightly / Common helpers 全量回归通过 步骤: 1. 进入仓库根目录 2. 执行: bash uv run python -m pytest tests/regression/scripts/helpers/ -q 结果: 341 passed, 5 warnings in 1.02s ### gate_policy 缓存失效 目的:确认 yaml mtime 变化后 load_gate_policy 缓存失效 步骤: 1. 运行单测: bash uv run python -m pytest tests/regression/scripts/helpers/ci_gate/test_gate_policy.py::test_load_gate_policy_cached_until_yaml_mtime_changes -v 结果:PASSED(修复同秒写入 mtime 未变导致的 flaky) ### pre-commit 目的:提交前 hook 全绿 步骤: 1. git commit 触发 pre-commit(ruff、pylint、bandit、typos 等) 结果:全部 Passed See merge request: Ascend/msmodeling!342 | 13 天前 | |
【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 | 18 天前 | |
【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !334 merge fix into develop 【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 背景 修复 CI 增量门禁多处漏检/误拦(含 #107):Phase 0 test_map 合并覆盖同 symbol、未映射 symbol 误拦、pytest 继承 addopts 行为不可控、exemptions.tests 整文件误豁免等。 Closes #107 --- ## 改动摘要 ### 策略与 coverage - **_merge_test_maps**:同 symbol test id **union**,不再 replace(修复 test_main_extra 等用例被跳过) - **coverage 兜底**:symbol 双 map 均无 → 查 Phase 0 .coverage(含 import 空 context)→ 放行 - **omit SSOT**:读 pyproject.toml [tool.coverage.run].omit;gate_policy.yaml 新增 roots,exemptions.tests 接入 Phase 0/2 ### Pytest 执行(pytest_runner.py) - 门禁 subprocess 统一 **-o addopts=** + **显式 -m** - **collect-first** → min(cpu, collected) + --dist worksteal - Phase 0: not npu;Phase 1/2 增量: not npu and not nightly and not network;config 全量: tests/ + not npu - 全量触发:conftest.py、requirements.txt、uv.lock 等;**不含** gate_policy.yaml ### exemptions.tests(node 级) - 登记必须为 pytest node(tests/...py::func 或 ...::Class::method),禁止 [、禁止 class-only、禁止整文件 pathspec 回退 - **Phase 0**:按改动文件 collect node → 过滤豁免 → 显式 node 列表跑 pytest+cov;全豁免打 log 跳过(避免 exit 5) - **Phase 2**:incremental_tests 过滤豁免 node - Phase 0 失败输出可复制 exemptions.tests YAML 模板 ### 可观测性 - Phase 0/1/2 及策略拦截日志:说明各阶段目的、失败含义、跳过原因 - run_*.sh:-vv;nested subprocess+cov+xdist 回归测试改 stub --- ## 自验证 bash uv run pytest tests/regression/scripts/helpers/ci_gate/ \ tests/regression/scripts/helpers/common/test_pytest_runner.py -q 141 passed See merge request: Ascend/msmodeling!334 | 13 天前 | |
【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Co-authored-by: liujiawang<anonymousdev@163.com> # message auto-generated for no-merge-commit merge: !334 merge fix into develop 【FIX】CI Gate 增量门禁加固:test_map 漏检修复、pytest 策略与 node 级豁免 Created-by: AvadaKedavrua Commit-by: liujiawang Merged-by: ascend-robot Description: ## 背景 修复 CI 增量门禁多处漏检/误拦(含 #107):Phase 0 test_map 合并覆盖同 symbol、未映射 symbol 误拦、pytest 继承 addopts 行为不可控、exemptions.tests 整文件误豁免等。 Closes #107 --- ## 改动摘要 ### 策略与 coverage - **_merge_test_maps**:同 symbol test id **union**,不再 replace(修复 test_main_extra 等用例被跳过) - **coverage 兜底**:symbol 双 map 均无 → 查 Phase 0 .coverage(含 import 空 context)→ 放行 - **omit SSOT**:读 pyproject.toml [tool.coverage.run].omit;gate_policy.yaml 新增 roots,exemptions.tests 接入 Phase 0/2 ### Pytest 执行(pytest_runner.py) - 门禁 subprocess 统一 **-o addopts=** + **显式 -m** - **collect-first** → min(cpu, collected) + --dist worksteal - Phase 0: not npu;Phase 1/2 增量: not npu and not nightly and not network;config 全量: tests/ + not npu - 全量触发:conftest.py、requirements.txt、uv.lock 等;**不含** gate_policy.yaml ### exemptions.tests(node 级) - 登记必须为 pytest node(tests/...py::func 或 ...::Class::method),禁止 [、禁止 class-only、禁止整文件 pathspec 回退 - **Phase 0**:按改动文件 collect node → 过滤豁免 → 显式 node 列表跑 pytest+cov;全豁免打 log 跳过(避免 exit 5) - **Phase 2**:incremental_tests 过滤豁免 node - Phase 0 失败输出可复制 exemptions.tests YAML 模板 ### 可观测性 - Phase 0/1/2 及策略拦截日志:说明各阶段目的、失败含义、跳过原因 - run_*.sh:-vv;nested subprocess+cov+xdist 回归测试改 stub --- ## 自验证 bash uv run pytest tests/regression/scripts/helpers/ci_gate/ \ tests/regression/scripts/helpers/common/test_pytest_runner.py -q 141 passed See merge request: Ascend/msmodeling!334 | 13 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 13 天前 | ||
| 18 天前 | ||
| 14 天前 | ||
| 13 天前 | ||
| 13 天前 | ||
| 18 天前 | ||
| 13 天前 | ||
| 13 天前 |