ci: reintroduce code coverage reporting with cargo-llvm-cov#23336
ci: reintroduce code coverage reporting with cargo-llvm-cov#23336buraksenn wants to merge 9 commits into
Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23336 +/- ##
=======================================
Coverage ? 80.61%
=======================================
Files ? 1086
Lines ? 364976
Branches ? 364976
=======================================
Hits ? 294216
Misses ? 53234
Partials ? 17526 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
As expected it could not compare since there is no code coverage uploaded for main branch. After this PR merges it will be ready |
| coverage: | ||
| name: coverage | ||
| needs: linux-build-lib | ||
| runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }} |
There was a problem hiding this comment.
will this consume more of our ASF runner time?
maybe we can try it for a while and make sure it is useful before we spend too much xtra time.
There was a problem hiding this comment.
this is correct can you check #23336 (comment)
|
would it also be an option to have it run occasionally on main only, to at least give us a general idea on the health of the codebase in terms of coverage, without consuming too many resources? 🤔 |
|
I've first introduced it as uncommenting the coverage step but cargo-llvm-cov internally runs cargo test and calculates coverage with it so instead of this I've changed cargo test amd64 with llvm-cov: Another approach would be adding it as nightly/weekly. @alamb @Jefffrey |
2010YOUY01
left a comment
There was a problem hiding this comment.
LGTM overall—thank you!
Andrew mentioned the resource-usage concern, so here is some background: our CI runner resources are provided by the ASF, and they have noted that DataFusion consumes a significant amount of compute. We are still within the hard limit, IIRC, but it would be good to continue reducing our usage as they suggested.
(I think the biggest contributor is PRs with dozens of commits, but we could address that separately.)
I would prefer to run this check on every PR. It is true that 100% line coverage does not necessarily imply good test quality; however, low coverage strongly suggests that we are missing test cases. I'd want to check the coverage metrics regularly when reviewing.
| const KB: usize = 1 << 10; | ||
| #[tokio::test] | ||
| #[cfg_attr(tarpaulin, ignore)] | ||
| #[cfg_attr(coverage, ignore)] |
There was a problem hiding this comment.
I think they're not needed:
datafusion/datafusion/core/tests/fuzz.rs
Line 21 in f87e817
Those tests are under extended_tests attribute, and now we run llvm-cov in the regular test suite, so those slow tests won't be included.
In the future if there are other tests that are too expensive to run for llvm-cov, I think we should also put them in extended_tests feature, then we don't have to manage this additional coverage attribute to keep things simpler.
There was a problem hiding this comment.
Thanks for the heads up, I did not think if they were necessary and blindly applied. Now they are removed




Which issue does this PR close?
Failed to compile tests! Error: sql_integration: linking withccfailed: exit status: 1"#3678.Rationale for this change
Code coverage has been disabled since #3678. The reason was it failed because of sql_integration test binary. This PR reintroduces it
What changes are included in this PR?
Reintroduce code coverage
Are these changes tested?
I've been successfully make it work in my fork: buraksenn#345

I needed to add
CODECOV_TOKENas a secret variable to the fork.You can check #23336 (comment) comment of codecov for successful run
Are there any user-facing changes?
no