Skip to content

ci: use LLVM instrumentation for coverage - #485

Merged
Mec-iS merged 1 commit into
smartcorelib:mainfrom
jolars:ci/llvm-coverage
Oct 12, 2026
Merged

Mec-iS merged 1 commit into
smartcorelib:mainfrom
jolars:ci/llvm-coverage

Conversation

@jolars

@jolars jolars commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #484

Current behavior

The Linux coverage job uses Tarpaulin's default ptrace engine. With the optimized test profile, it can report executed source lines as uncovered. PR #480 exposed this in matrix products and estimator fits that the existing tests call.

New expected behavior

Install llvm-tools-preview with the nightly toolchain and run Tarpaulin with --engine llvm. LLVM instrumentation measures execution without relying on debug line mappings. The job still runs unit tests, integration tests, and doctests, produces LCOV output, and enforces the existing 44% threshold.

Validation

  • The complete coverage command passed on this branch with nightly Rust and Tarpaulin 0.37.5:
    cargo tarpaulin --engine llvm --all-features --run-types Tests --run-types Doctests --out Lcov --fail-under 44 -- --test-threads 1
    Local coverage: 85.18% (7,897 of 9,271 measured lines).
  • cargo fmt --all -- --check passed.
  • cargo clippy --all-features -- -Drust-2018-idioms -Drust-2024-compatibility -Dwarnings passed.

Checklist

  • Branch is up to date with main.
  • Unit tests, integration tests, and doctests pass under the coverage toolchain.
  • Coverage and lint checks pass.

@jolars
jolars requested a review from Mec-iS as a code owner October 10, 2026 18:23
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.10%. Comparing base (9eaae9e) to head (34300d7).
⚠️ Report is 196 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #485       +/-   ##
===========================================
+ Coverage   43.97%   85.10%   +41.12%     
===========================================
  Files          85       96       +11     
  Lines        7281     9271     +1990     
===========================================
+ Hits         3202     7890     +4688     
+ Misses       4079     1381     -2698     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mec-iS
Mec-iS merged commit 20cc502 into smartcorelib:main Oct 12, 2026
15 checks passed
@Mec-iS Mec-iS mentioned this pull request Oct 12, 2026
3 tasks done
Mec-iS added a commit that referenced this pull request Oct 12, 2026
* chore: fold unreleased changes into the 0.6.16 release notes

0.6.16 has not been published to crates.io yet, so the [Unreleased]
section is folded into the existing 0.6.16 entry instead of opening
a new version. Covers #475, #478, #481, #482, #485.

All release gates verified locally:
- cargo test --all-features (614 unit + 73 doctests, 0 failed)
- cargo fmt --all -- --check
- cargo clippy --all-features (2018+2024 idioms, -Dwarnings)
- cargo +1.85.0 build --all-features (MSRV)
- cargo package (146 files, 2.1MiB)

* ci: run coverage in release mode and shrink test_logit

The LLVM coverage engine instruments the whole serial test run
(--test-threads 1). On a slow shared runner the instrumented run
could exceed tarpaulin's default 60 s per-binary timeout; observed
as 'Timed out waiting for test response' while test_logit (a
52181x94 logistic-regression fit) was running.

Two changes:
- test_logit now uses a 10000x94 matrix with the same class ratio
  (418 of 10000 positive). The test asserts the same property and
  finishes in ~0.5 s instead of ~3.5 s.
- The coverage job builds in release mode (--release) and raises
  the tarpaulin timeout to 600 s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use LLVM instrumentation for accurate coverage reports

2 participants