Repository navigation
fix(test): add lcov 2.x version-gated --ignore-errors for coverage scripts - #467
Conversation
…ripts CI 镜像 lcov 为 2.x,对 gcov 计数器与源码不一致(inconsistent/mismatch) 直接报错中断,任一阶段失败都会导致覆盖率无法产出(与 deepin-screen-recorder #553、deepin-terminal #531 同因)。按版本门控 (lcov >= 2 才加 --ignore-errors inconsistent,mismatch)注入全部 lcov/genhtml 调用,lcov 1.x 行为不变。 PMS: TASK-398635 Log: CI 单测覆盖率流水线 lcov 2.x 兼容 Influence: 不影响 lcov 1.x 本地行为
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideTestsAdd lcov-version-gated ignore-error options to the coverage scripts’ lcov and genhtml calls, while preserving lcov 1.x behavior and updating the SPDX headers.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/test-prj-running.sh" line_range="111" />
<code_context>
# Generate HTML report
-genhtml -o ./html ./coverage.info
+genhtml $LCOV_IGN -o ./html ./coverage.info
# Rename main index for downstream tooling
</code_context>
<issue_to_address>
**Coverage summary drops metrics**
When lcov 2.x encounters inconsistent or mismatched data while producing the summary, `gen-ut-summary.py` later runs `lcov --summary` without the version-gated ignore option; when that command rejects mismatched coverage data, its output has no metrics for the parser, so `ut-summary.json` is written without coverage fields.
Pass the same version-gated ignore option to the summary invocation, or otherwise handle a failed summary without silently omitting its metrics.
</issue_to_address>|
|
||
| # Generate HTML report | ||
| genhtml -o ./html ./coverage.info | ||
| genhtml $LCOV_IGN -o ./html ./coverage.info |
There was a problem hiding this comment.
🟡 Medium · Coverage summary drops metrics
When lcov 2.x encounters inconsistent or mismatched data while producing the summary, gen-ut-summary.py later runs lcov --summary without the version-gated ignore option; when that command rejects mismatched coverage data, its output has no metrics for the parser, so ut-summary.json is written without coverage fields.
Pass the same version-gated ignore option to the summary invocation, or otherwise handle a failed summary without silently omitting its metrics.
Prompt for AI agents
In `tests/test-prj-running.sh` at line 111:
**Coverage summary drops metrics**
When lcov 2.x encounters inconsistent or mismatched data while producing the summary, `gen-ut-summary.py` later runs `lcov --summary` without the version-gated ignore option; when that command rejects mismatched coverage data, its output has no metrics for the parser, so `ut-summary.json` is written without coverage fields.
Pass the same version-gated ignore option to the summary invocation, or otherwise handle a failed summary without silently omitting its metrics.- 单年份版权行更新为创建年-2026 区间(CI SPDX 检查要求) - 为缺失 SPDX header 的脚本补充版权与 license 声明 PMS: TASK-398635 Log: CI SPDX 检查修复 Influence: 仅注释变更,不影响脚本逻辑
|
/forcemerge |
|
This pr force merged! (status: blocked, merge_method: rebase) |
问题
Gerrit-unittest-check 流水线 CI 镜像的 lcov 为 2.x,对 gcov 计数器与源码不一致(
ERROR: (inconsistent) mismatched end line)直接报错中断。项目中所有 lcov/genhtml 调用均未带--ignore-errors,任一阶段(capture/extract/remove/genhtml)失败即覆盖率无法产出,流水线记录 0.0%。deepin-screen-recorder(#553/#555/#561,PR #1101/#1103)与 deepin-terminal(#531/#544/#545,PR #608/#609)已确认并修复同因问题:terminal 修复后覆盖率 80.30%、screen-recorder 83.10%。
修复
lcov --version提取主版本号,>= 2 时LCOV_IG15="--ignore-errors inconsistent,mismatch"$LCOV_IGN(共 N 处)LCOV_IGN为空,行为不变-验证
bash -n全部通过e4798910、deepin-screen-recorder82ae9f30完全一致(CI 已验证)PMS: TASK-398635
Summary by Sourcery
Make coverage scripts tolerate inconsistent gcov data on lcov 2.x.
Bug Fixes:
Chores: