ci: add Rust code coverage with Codecov#3189
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds code coverage tooling: a new Codecov configuration, CI workflow changes to collect and upload coverage via cargo llvm-cov, and README additions showing overall and per-crate Codecov badges. Changes
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Runner as CI Runner
participant Rust as Rust Toolchain
participant LLVM as LLVM Tools
participant Codecov as Codecov Service
GH->>Runner: trigger tests job
Runner->>Rust: setup Rust (with components)
Rust->>LLVM: ensure llvm-tools installed
Runner->>Runner: run `cargo llvm-cov test` → generate `lcov.info`
Runner->>Codecov: upload `lcov.info` (per-package flag)
Codecov-->>Codecov: process coverage metrics
Codecov-->>GH: report completed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.codecov.yml (1)
32-69: Component coverage currently tracks only a subset of workspace crates.This list covers key crates, but many workspace Rust crates remain outside component-level reporting/badges. Consider either adding components for all Rust crates or narrowing wording/docs to “selected/key crates” to avoid expectation drift.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.codecov.yml around lines 32 - 69, The component list under component_management -> individual_components in .codecov.yml only includes a subset of Rust workspace crates (entries like component_id: dpp, drive, drive-abci, sdk, etc.); either add missing crates by creating corresponding component entries (component_id, name, paths pointing to each packages/rs-<crate>/ directory) for every workspace Rust crate you want covered, or update any documentation/labels that reference this list to say “selected/key crates” to avoid implying full coverage—make the change by editing .codecov.yml and/or the docs where the component list is described.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.codecov.yml:
- Line 9: Remove the global ignore pattern "**/mod.rs" from .codecov.yml and
instead ignore only test-only mod.rs files (for example change the pattern to
target test directories like "tests/**/mod.rs" or "**/tests/**/mod.rs" or other
repo-specific test paths); update the ignore list so production module files
named mod.rs are not excluded, ensuring only test-only paths are scoped for
exclusion.
---
Nitpick comments:
In @.codecov.yml:
- Around line 32-69: The component list under component_management ->
individual_components in .codecov.yml only includes a subset of Rust workspace
crates (entries like component_id: dpp, drive, drive-abci, sdk, etc.); either
add missing crates by creating corresponding component entries (component_id,
name, paths pointing to each packages/rs-<crate>/ directory) for every workspace
Rust crate you want covered, or update any documentation/labels that reference
this list to say “selected/key crates” to avoid implying full coverage—make the
change by editing .codecov.yml and/or the docs where the component list is
described.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c1e1598b-f11f-4d44-9779-739ad3017f7b
📒 Files selected for processing (3)
.codecov.yml.github/workflows/tests-rs-package.ymlREADME.md
Add llvm-cov instrumentation to Rust package tests and upload coverage reports to Codecov with per-package flags. - Replace `cargo test` with `cargo llvm-cov test` in tests-rs-package.yml - Add .codecov.yml with component definitions for key crates - Add coverage badge and per-crate table to README.md - Ignore test files, FFI crates, and WASM bindings from coverage Requires CODECOV_TOKEN secret to be configured in repo settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `**/mod.rs` glob was excluding 528 production module files from coverage reporting. Test mod.rs files are already covered by `**/tests/**`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fabe080 to
1e4b551
Compare
lklimek
left a comment
There was a problem hiding this comment.
I assume you tested codecov config locally, so I approve
Issue being fixed or feature implemented
Adds code coverage reporting for all Rust crates, matching the pattern used in grovedb.
What was done?
Coverage Instrumentation
tests-rs-package.ymlto usecargo llvm-cov testinstead ofcargo testllvm-toolscomponent andcargo-llvm-covviataiki-e/install-actionCodecov Configuration (
.codecov.yml)rs-sdk-ffi,rs-platform-wallet-ffi), and WASM bindingsREADME
How Has This Been Tested?
The workflow change is additive —
cargo llvm-cov testruns the same tests ascargo testbut with coverage instrumentation.Breaking Changes
None. Coverage upload uses
fail_ci_if_error: falseso missing token (fork PRs) won't break CI.Setup Required
CODECOV_TOKENsecret to repo settings (get from https://codecov.io after enabling the repo)Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation