fix(ci): use cargo-llvm-cov properly for Python SDK coverage in Codecov#2867
Merged
hubcio merged 3 commits intoapache:masterfrom Mar 4, 2026
Merged
Conversation
e262f64 to
cc964ae
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2867 +/- ##
============================================
+ Coverage 67.85% 68.40% +0.54%
Complexity 739 739
============================================
Files 1052 1052
Lines 84635 84635
Branches 61213 61224 +11
============================================
+ Hits 57432 57892 +460
+ Misses 24833 24363 -470
- Partials 2370 2380 +10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
cc964ae to
c2ff331
Compare
Contributor
Author
|
pls check there's 2 flaky tests |
spetz
approved these changes
Mar 4, 2026
hubcio
approved these changes
Mar 4, 2026
kriti-sc
pushed a commit
to kriti-sc/iggy
that referenced
this pull request
Mar 6, 2026
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.
Which issue does this PR close?
Closes #2866
Rationale
The Python SDK is built with maturin/PyO3, so all business logic is compiled Rust. The previous two attempts (PR #2790 with pytest-cov, PR #2817 with manual llvm-cov) both failed: pytest-cov cannot measure Rust code, and the manual llvm-cov approach produced 0% coverage due to missing CARGO_TARGET_DIR centralization and LCOV source paths relative to the crate root instead of the repo root.
What changed?
Coverage reports were empty because raw llvm-profdata/llvm-cov export produced paths like
src/client.rswhile Codecov expectedforeign/python/src/client.rsunder the python flag. Dependency code from core/sdk also leaked into the report with no filtering.The fix rewrites both post-merge and pre-merge coverage pipelines to use cargo-llvm-cov properly (matching the existing Rust coverage job pattern and the cjermain/rust-python-coverage reference). It sources env vars via
cargo llvm-cov show-env, centralizes CARGO_TARGET_DIR, drops --release from maturin develop, generates LCOV withcargo llvm-cov report, filters dependencies with --ignore-filename-regex, and fixes paths with sed.Local Execution
AI Usage