-
-
Notifications
You must be signed in to change notification settings - Fork 153
Description
π 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:
-
Add:
cargo test --workspace --all-features -
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:
-
Add a dedicated step for:
cargo test --workspace --all-features -
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-featuresbuilds. - 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