Skip to content

Commit cfe5829

Browse files
committed
ci: raise coverage thresholds from 0% to meaningful levels
Set coverage gates based on current real metrics with ~5% buffer: - Full: line 85%, branch 78% - Incremental: line 85%, branch 75% - Per-directory overrides for utils (90/90), knowledgebase (95/90), memory_collection (80/50), conversation_service (65/60) Change-Id: I7bb247168d1907ca53b46989021b7cd77ed5b2f0 Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
1 parent 333f548 commit cfe5829

1 file changed

Lines changed: 59 additions & 19 deletions

File tree

‎coverage.yaml‎

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,82 @@
33
#
44
# 注意:文件排除配置已迁移到 pyproject.toml 的 [tool.coverage.*] 部分
55
# Note: File exclusion settings have been moved to [tool.coverage.*] in pyproject.toml
6+
#
7+
# 调整策略 / Calibration strategy:
8+
# - 全量阈值取自当前真实覆盖率(line 90.74% / branch 82.85%)下方约 5% 的 buffer,
9+
# 作为"不回退"闸;既能挡住明显回归,又不会被 CI 抖动误伤。
10+
# - 增量阈值更高一些,推动新增代码自带测试;首次新建文件等极端情况下仍可通过。
11+
# - memory_collection 和 conversation_service 历史覆盖率较低,单独 override
12+
# 到不严于当前现状的水位,等待后续专项补测试再统一上调。
13+
#
14+
# Calibration strategy:
15+
# - Full thresholds sit ~5% below current real coverage (line 90.74% / branch 82.85%)
16+
# to act as a "no regression" gate without flapping on CI noise.
17+
# - Incremental thresholds are higher to drive tests for new code.
18+
# - memory_collection / conversation_service have historically lower coverage;
19+
# their overrides sit no stricter than today and will be tightened in a
20+
# dedicated test-improvement pass later.
621

722
# ============================================================================
823
# 全量代码覆盖率要求
924
# ============================================================================
1025
full:
1126
# 分支覆盖率要求 (百分比)
12-
branch_coverage: 0
27+
branch_coverage: 78
1328
# 行覆盖率要求 (百分比)
14-
line_coverage: 0
29+
line_coverage: 85
1530

1631
# ============================================================================
1732
# 增量代码覆盖率要求 (相对于基准分支的变更代码)
1833
# ============================================================================
1934
incremental:
2035
# 分支覆盖率要求 (百分比)
21-
branch_coverage: 0
36+
branch_coverage: 75
2237
# 行覆盖率要求 (百分比)
23-
line_coverage: 0
38+
line_coverage: 85
2439

2540
# ============================================================================
2641
# 特定目录的覆盖率要求
2742
# 可以为特定目录设置不同的覆盖率阈值
2843
# ============================================================================
2944
directory_overrides:
30-
# 示例:为特定目录设置不同的阈值
31-
agentrun/knowledgebase:
32-
full:
33-
branch_coverage: 0
34-
line_coverage: 0
35-
incremental:
36-
branch_coverage: 0
37-
line_coverage: 0
38-
agentrun/utils:
39-
full:
40-
branch_coverage: 90
41-
line_coverage: 90
42-
incremental:
43-
branch_coverage: 90
44-
line_coverage: 90
45+
# utils 模块要求高覆盖率(基础设施代码)
46+
# / utils module is infrastructure code, requires high coverage
47+
agentrun/utils:
48+
full:
49+
branch_coverage: 90
50+
line_coverage: 90
51+
incremental:
52+
branch_coverage: 90
53+
line_coverage: 90
54+
55+
# knowledgebase 历史保持高覆盖率
56+
# / knowledgebase has historically maintained high coverage
57+
agentrun/knowledgebase:
58+
full:
59+
branch_coverage: 90
60+
line_coverage: 95
61+
incremental:
62+
branch_coverage: 90
63+
line_coverage: 90
64+
65+
# memory_collection 历史 branch 覆盖率较低(56.11%),先放行不回退
66+
# / memory_collection has historically low branch coverage (56.11%); allow
67+
# current state, plan to tighten later
68+
agentrun/memory_collection:
69+
full:
70+
branch_coverage: 50
71+
line_coverage: 80
72+
incremental:
73+
branch_coverage: 75
74+
line_coverage: 85
75+
76+
# conversation_service 历史覆盖率较低(line 70.68% / branch 64.94%)
77+
# / conversation_service has historically lower coverage; allow current state
78+
agentrun/conversation_service:
79+
full:
80+
branch_coverage: 60
81+
line_coverage: 65
82+
incremental:
83+
branch_coverage: 75
84+
line_coverage: 85

0 commit comments

Comments
 (0)