[PR #525] Add code coverage with cargo-llvm-cov #537

Closed
opened 2026-03-02 04:13:55 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/git-ai-project/git-ai/pull/525

State: closed
Merged: Yes


Summary

  • Add LLVM source-based code coverage infrastructure using cargo-llvm-cov, the community-standard Rust coverage tool
  • Add llvm-tools-preview extension and cargo-llvm-cov to the Nix dev shell for local coverage runs
  • Add four task commands: coverage, coverage:html, coverage:lcov, coverage:check
  • Add CI workflow that runs coverage on every PR/push/merge-group, enforces a 50% line coverage threshold, and uploads HTML + LCOV reports as artifacts

Coverage baseline

Current line coverage measured at ~56% (585 tests passing). The CI threshold is set to 50% to provide regression protection with buffer for normal fluctuations. This can be ratcheted up as test coverage improves.

Local usage

# Within nix develop:
task coverage          # Console summary
task coverage:html     # HTML report, opens in browser
task coverage:lcov     # Generate lcov.info for IDE integration
task coverage:check    # Fail if below 50% threshold

Test plan

  • CI coverage workflow runs and passes on ubuntu-latest
  • HTML coverage report is uploaded as artifact
  • LCOV report is uploaded as artifact
  • Coverage threshold enforcement works (would fail if coverage drops below 50%)
  • nix develop provides cargo-llvm-cov and llvm-tools-preview

🤖 Generated with Claude Code


Open with Devin
**Original Pull Request:** https://github.com/git-ai-project/git-ai/pull/525 **State:** closed **Merged:** Yes --- ## Summary - Add LLVM source-based code coverage infrastructure using `cargo-llvm-cov`, the community-standard Rust coverage tool - Add `llvm-tools-preview` extension and `cargo-llvm-cov` to the Nix dev shell for local coverage runs - Add four `task` commands: `coverage`, `coverage:html`, `coverage:lcov`, `coverage:check` - Add CI workflow that runs coverage on every PR/push/merge-group, enforces a 50% line coverage threshold, and uploads HTML + LCOV reports as artifacts ## Coverage baseline Current line coverage measured at **~56%** (585 tests passing). The CI threshold is set to **50%** to provide regression protection with buffer for normal fluctuations. This can be ratcheted up as test coverage improves. ## Local usage ```bash # Within nix develop: task coverage # Console summary task coverage:html # HTML report, opens in browser task coverage:lcov # Generate lcov.info for IDE integration task coverage:check # Fail if below 50% threshold ``` ## Test plan - [ ] CI coverage workflow runs and passes on ubuntu-latest - [ ] HTML coverage report is uploaded as artifact - [ ] LCOV report is uploaded as artifact - [ ] Coverage threshold enforcement works (would fail if coverage drops below 50%) - [ ] `nix develop` provides `cargo-llvm-cov` and `llvm-tools-preview` 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/git-ai-project/git-ai/pull/525" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
kerem 2026-03-02 04:13:55 +03:00
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
starred/git-ai#537
No description provided.