kornia/kornia-rs

[CI]: Add feature matrix and --all-features test coverage

開放

#751 建立於 2026年2月24日

 (5 則留言) (0 個反應) (1 位負責人)Rust (188 個分叉)auto 404
enhancementhelp wantedtriage

倉庫指標

星標
 (675 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

🚀 Feature Description

Motivation

While #736 ensures cargo check --workspace --all-targets --all-features runs in CI, test coverage across feature configurations is still limited.

Feature-gated code and optional dependencies can compile successfully but remain untested under certain configurations. Over time, this may lead to feature drift or regressions in non-default builds.

Proposal

Extend CI coverage to validate both compilation and test execution across feature combinations:

  1. Add: cargo test --workspace --all-features

  2. Introduce a feature matrix strategy covering:

    • Default features
    • All features
    • Minimal features (--no-default-features)

This ensures:

  • Feature-gated test paths are exercised
  • Optional dependencies remain validated
  • Both minimal and maximal configurations remain healthy

Happy to prepare a focused PR if this direction aligns with project goals.

📂 Feature Category

Rust Core Library

💡 Motivation

Currently, CI validates compilation across all features (via #736), but it does not execute tests across feature combinations.

This creates a potential blind spot where:

  • Feature-gated test code may silently break
  • Optional dependencies may compile but fail at runtime
  • Minimal builds (--no-default-features) may drift over time

Improving CI coverage across feature configurations strengthens reliability and long-term maintainability.

💭 Proposed Solution

Update the existing GitHub Actions workflow to:

  1. Add a dedicated step for: cargo test --workspace --all-features

  2. Introduce a job matrix similar to:

    • default
    • all-features
    • no-default-features

Each job would run: cargo check cargo test

Keeping them as separate CI steps makes failures easier to diagnose and avoids conflating feature-related issues.

📚 Library Reference

This approach follows common Rust CI best practices used in projects such as:

  • tokio
  • serde
  • clap

Many mature Rust crates validate default, minimal, and full feature sets to prevent feature drift and optional dependency breakage.

🔄 Alternatives Considered

An alternative would be to rely solely on cargo check --all-features, but this does not execute test code.

Another option is to selectively test only certain feature combinations; however, a small matrix approach provides stronger guarantees while keeping CI manageable.

🎯 Use Cases

  • Ensuring optional dependencies remain functional.
  • Preventing regressions in --no-default-features builds.
  • Validating feature-gated test modules.
  • Increasing confidence for downstream users integrating kornia-rs in custom configurations.

📝 Additional Context

No response

🤝 Contribution Intent

  • I plan to submit a PR to implement this feature
  • I'm requesting this feature but not planning to implement it

貢獻者指南