Repository navigation
ci: 覆盖率门禁改用 cargo-nextest 运行 Rust 测试 - #248
Merged
Merged
Conversation
`cargo llvm-cov` 按二进制一个接一个地跑测试:2026-11-10 的 CI 上 101 个测试二进制自身用了 426 秒,其中 voltip-core 的 tests/long.rs 一个就 209 秒,别的二进制只能等它跑完。 - Makefile:coverage-gate 改为 `cargo llvm-cov nextest`,参数不变,缺 cargo-nextest 时直接报错。 - .config/nextest.toml:失败全部报告(fail-fast = false);跑过 60 秒标为 SLOW, 跑过 10 分钟终止并记为 TIMEOUT,挂住的测试在 CI 步骤的 25 分钟上限之前就失败并留下名字。 - ci.yml:cargo-nextest 0.9.151 由同一个 install-action 预编译安装(CARGO_NEXTEST_VERSION)。 - AGENTS.md、docs/runbook.md 同步说明。 本机 32 核、构建已缓存:覆盖率门禁 431 → 278 秒;2086 个测试通过、42 个跳过,与原来一致; 行覆盖率 92.95%,与原来一致。
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #248 +/- ##
==========================================
- Coverage 93.57% 93.55% -0.02%
==========================================
Files 489 489
Lines 85860 85860
Branches 4909 4909
==========================================
- Hits 80341 80329 -12
- Misses 4850 4862 +12
Partials 669 669
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
CI 的
verify · rust gates里,覆盖率门禁(make coverage-gate)是最长的一步:最近 5 次main运行分别是 699、682、510、701、597 秒,中位数 682 秒。cargo llvm-cov按二进制一个接一个地跑测试,101 个测试二进制自身用了 426 秒,其中 voltip-core 的tests/long.rs一个就 209 秒,其他二进制只能等它跑完。改动
Makefile:coverage-gate改为cargo llvm-cov nextest,其余参数不变;没装 cargo-nextest 时直接报错。coverage-lcov照旧从这次运行的数据生成 lcov。.config/nextest.toml(新):fail-fast = false,一次报告所有失败;跑过 60 秒的测试标为SLOW,跑过 10 分钟的被终止并记为TIMEOUT,挂住的测试会在 CI 步骤的 25 分钟上限之前失败并在日志里留下名字。ci.yml:CARGO_NEXTEST_VERSION: 0.9.151,用同一个taiki-e/install-action(已钉 SHA,其清单里有 0.9.151)预编译安装。AGENTS.md、docs/runbook.md:挂住的测试现在看SLOW/TIMEOUT,不再是 libtest 的 "running for over 60 seconds"。本机结果(32 核,构建已缓存)
cargo llvm-cov)cargo llvm-cov nextest)profraw 文件 2311 个,共 796 MB。
make verify(4573d07b)overall_exit=0,门禁 279 秒;rebase 到 #247 之后无冲突。保留还是关闭
这次 PR 的 CI 运行(
verify-rust-log)同时满足下面几条才合并,否则关闭这个 PR:test result:合计一致;rust-coverage的secs=不超过 562(最近 5 次main的中位数 682 减 120);CI Success与Release candidate都通过。Verification
make verify(4573d07b):overall_exit=0actionlint .github/workflows/ci.yml.github/scripts/check-no-production-hosts.sh)风险与回退
只改 CI 跑 Rust 测试的方式,产品代码不变。每个测试一个进程后,依赖同一进程里共享状态的测试会暴露出来;本机全量跑过,没有这类失败。回退就是还原这次提交。