Skip to content

Add filter to only run integration tests. #8396

@jschwe

Description

@jschwe

Describe the problem you are trying to solve

Currently cargo test --tests runs both unit and integration tests. Using cargo test --lib runs only the unit-tests of the library, however there is no way to only let the integration tests run, apart from maybe using a naming scheme for the integration tests, which I would like to avoid. It's also possible to write a script which calls cargo test --test <name> for each .rs file in the tests folder, but again, this is something I would like to avoid.

Describe the solution you'd like

I would like to run only the integration tests with e.g. cargo test --integration_tests.

Notes

Looking into libtest the enum TestType seems to already provide the necessary information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)A-cliArea: Command-line interface, option parsing, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions