[GH-ISSUE #1169] [FR]: Code coverage for Rust #462

Closed
opened 2026-03-23 20:36:50 +00:00 by mirror · 4 comments
Owner

Originally created by @appflowy on GitHub (Sep 26, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1169

Originally assigned to: @SwapnilKumbhar on GitHub.

Enable code coverage for Rust code.

  • Run in CI, PRs, and centrally for a team
  • Run locally for fast feedback for an individual.

Reference:

Originally created by @appflowy on GitHub (Sep 26, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1169 Originally assigned to: @SwapnilKumbhar on GitHub. Enable code coverage for Rust code. * Run in CI, PRs, and centrally for a team * Run locally for fast feedback for an individual. Reference: * [How to do code coverage in Rust](https://blog.rng0.io/how-to-do-code-coverage-in-rust)
mirror 2026-03-23 20:36:50 +00:00
Author
Owner

@SwapnilKumbhar commented on GitHub (Sep 27, 2022):

I'd love to help with this! Just had a few questions -

Run in CI, PRs, and centrally for a team

What does "centrally for a team" mean here?

Run locally for fast feedback for an individual.

Like an xtask?

<!-- gh-comment-id:1258878962 --> @SwapnilKumbhar commented on GitHub (Sep 27, 2022): I'd love to help with this! Just had a few questions - > Run in CI, PRs, and centrally for a team What does "centrally for a team" mean here? > Run locally for fast feedback for an individual. Like an `xtask`?
Author
Owner

@appflowy commented on GitHub (Sep 27, 2022):

What does "centrally for a team" mean here?

Yep, we can run the coverage on the local machine.

Like an xtask?

Yes, just like the xtask. Is it possible to use cargo make instead of xtask? Because AppFlowy use cargo make as the task runner.

<!-- gh-comment-id:1258887277 --> @appflowy commented on GitHub (Sep 27, 2022): > What does "centrally for a team" mean here? Yep, we can run the coverage on the local machine. > Like an `xtask`? Yes, just like the `xtask`. Is it possible to use [cargo make ](https://github.com/sagiegurari/cargo-make) instead of `xtask`? Because AppFlowy use [cargo make ](https://github.com/sagiegurari/cargo-make) as the task runner.
Author
Owner

@SwapnilKumbhar commented on GitHub (Sep 27, 2022):

Understood. I'll try to use cargo make on priority, glancing at the project makes me confident that it would be possible. I'll post here if it seems difficult with cargo make.

<!-- gh-comment-id:1258980056 --> @SwapnilKumbhar commented on GitHub (Sep 27, 2022): Understood. I'll try to use `cargo make` on priority, glancing at the project makes me confident that it would be possible. I'll post here if it seems difficult with `cargo make`.
Author
Owner

@SwapnilKumbhar commented on GitHub (Oct 3, 2022):

After understanding a few initial details about the task, I have a few questions -

  1. Currently, the rust-lib and shared-lib are both targeting rustc version 1.58. However, coverage instrumentation is introduced in 1.60. So to use it, I have to either upgrade rustc in rust-toolchain.toml or use a nightly version with coverage as an experimental function. Both of these changes affect seem significant. What should I do here?
  2. Since we want coverage reports in the CI, Github actions has a few marketplace plugins that help display lcov style reports in the PR or CI results. Do you have a specific plugin in mind that I should use for this?
<!-- gh-comment-id:1266149165 --> @SwapnilKumbhar commented on GitHub (Oct 3, 2022): After understanding a few initial details about the task, I have a few questions - 1. Currently, the `rust-lib` and `shared-lib` are both targeting `rustc` version `1.58`. However, coverage instrumentation is introduced in `1.60`. So to use it, I have to either upgrade `rustc` in rust-toolchain.toml or use a nightly version with coverage as an experimental function. Both of these changes affect seem significant. What should I do here? 2. Since we want coverage reports in the CI, Github actions has a few marketplace plugins that help display `lcov` style reports in the PR or CI results. Do you have a specific plugin in mind that I should use for this?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#462
No description provided.