Skip to content

Add Codecov coverage reporting (Rust) #14

Description

@rmems

Summary

Add Codecov integration for Rust code coverage reporting on the cortex-tensor crate.

Currently CI runs cargo test (in .github/workflows/rust.yml) but produces no coverage data or reports.

See: https://about.codecov.io/language/rust/

Motivation

  • Track and improve test coverage over time
  • Surface untested paths in critical areas (MoE routing, GGUF parsing, dequantization, tensor ops, transformer blocks)
  • Get PR comments / status checks from Codecov
  • Align with org practices (other Limen-Neural / rmems repos have used Codecov)

Recommended approach (modern Rust + Codecov)

Preferred tool: cargo-llvm-cov (excellent support for recent Rust editions, including 2024; produces clean LCOV).

Example steps in CI:

- name: Install cargo-llvm-cov
  uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate coverage
  run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

- name: Upload to Codecov
  uses: codecov/codecov-action@v4
  with:
    files: lcov.info
    fail_ci_if_error: true
    token: ${{ secrets.CODECOV_TOKEN }}

Handle missing token gracefully (like the existing Snyk steps) so forks/PRs from external contributors don't break.

Scope / Tasks

  • Add coverage collection step to the Rust workflow (or a matrix job)
  • Add codecov.yml at repo root with Rust-appropriate settings:
    • ignore: ["target/", "examples/"]
    • comment: on PRs
    • coverage thresholds if desired (start lenient)
  • Add Codecov badge to README.md (shields or codecov.io link)
  • Document the token requirement in any CI docs / workflow comments
  • Ensure cargo test behavior is unchanged when coverage is not collected
  • (Optional) Wire into Azure Pipelines if we want cross-platform coverage numbers

Non-goals

  • Do not change the public API or add runtime dependencies for coverage
  • Do not enforce strict coverage gates on day one (can be added later)

Acceptance Criteria

References

Suggested branch: feat/add-codecov


Created via agent request for structured coverage addition.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions