Skip to content

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

@Ayushi6002

Description

@Ayushi6002

πŸš€ 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is neededtriagewait for a maintainer to approve and assign this ticket

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions