Skip to content

Testing whole workspace with features enabled in some crate(s) #6195

Closed
@djc

Description

Problem
I have a workspace with a testing crate and some unit tests in other crates. Some tests need big dependencies, so I'd like to disable these by default and enable them only in CI. In CI, I then want to run all the tests, enabling the features for these tests. Here are some things I've tried:

cargo test --all --features dependency-test
cargo test --all --features testing/dependency-test (testing is the directory the testing crate lives in relative to the workspace root)
cargo test --all --features project_testing/dependency-test (project_testing is the package.name for the testing crate)

However, none of these seem to actually run the tests in question, whereas I'd expect at least one of them would (most likely the latter one?).

Actual use case is https://github.com/djc/askama, the actix feature in the testing crate. (Prototype change is here: https://github.com/djc/askama/compare/actix-off?expand=1).

Testing with stable Rust/Cargo on either macOS or (Linux) Travis.

Metadata

Assignees

No one assigned

    Labels

    A-featuresArea: features — conditional compilationA-workspacesArea: workspaces

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions