Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature flag for the async-std runtime #148

Closed
sholderbach opened this issue May 23, 2022 · 5 comments
Closed

Feature flag for the async-std runtime #148

sholderbach opened this issue May 23, 2022 · 5 comments

Comments

@sholderbach
Copy link

First of all I absolutely love this crate to quickly build up many test cases.

With the most recent release the number of dependencies of rstest has grown significantly.
Would it be feasible, to make the dependency on async-std switchable with a feature?

cargo tree with v0.13.0

├── rstest v0.13.0
│   ├── async-std v1.11.0
│   │   ├── async-attributes v1.1.2 (proc-macro)
│   │   │   ├── quote v1.0.18 (*)
│   │   │   └── syn v1.0.95 (*)
│   │   ├── async-channel v1.6.1
│   │   │   ├── concurrent-queue v1.2.2
│   │   │   │   └── cache-padded v1.2.0
│   │   │   ├── event-listener v2.5.2
│   │   │   └── futures-core v0.3.21
│   │   ├── async-global-executor v2.0.4
│   │   │   ├── async-channel v1.6.1 (*)
│   │   │   ├── async-executor v1.4.1
│   │   │   │   ├── async-task v4.2.0
│   │   │   │   ├── concurrent-queue v1.2.2 (*)
│   │   │   │   ├── fastrand v1.7.0
│   │   │   │   ├── futures-lite v1.12.0
│   │   │   │   │   ├── fastrand v1.7.0
│   │   │   │   │   ├── futures-core v0.3.21
│   │   │   │   │   ├── futures-io v0.3.21
│   │   │   │   │   ├── memchr v2.5.0
│   │   │   │   │   ├── parking v2.0.0
│   │   │   │   │   ├── pin-project-lite v0.2.9
│   │   │   │   │   └── waker-fn v1.1.0
│   │   │   │   ├── once_cell v1.12.0
│   │   │   │   └── slab v0.4.6
│   │   │   ├── async-io v1.6.0
│   │   │   │   ├── concurrent-queue v1.2.2 (*)
│   │   │   │   ├── futures-lite v1.12.0 (*)
│   │   │   │   ├── libc v0.2.126
│   │   │   │   ├── log v0.4.17 (*)
│   │   │   │   ├── once_cell v1.12.0
│   │   │   │   ├── parking v2.0.0
│   │   │   │   ├── polling v2.2.0
│   │   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   │   ├── libc v0.2.126
│   │   │   │   │   └── log v0.4.17 (*)
│   │   │   │   ├── slab v0.4.6
│   │   │   │   ├── socket2 v0.4.4
│   │   │   │   │   └── libc v0.2.126
│   │   │   │   └── waker-fn v1.1.0
│   │   │   ├── async-mutex v1.4.0
│   │   │   │   └── event-listener v2.5.2
│   │   │   ├── blocking v1.2.0
│   │   │   │   ├── async-channel v1.6.1 (*)
│   │   │   │   ├── async-task v4.2.0
│   │   │   │   ├── atomic-waker v1.0.0
│   │   │   │   ├── fastrand v1.7.0
│   │   │   │   ├── futures-lite v1.12.0 (*)
│   │   │   │   └── once_cell v1.12.0
│   │   │   ├── futures-lite v1.12.0 (*)
│   │   │   ├── num_cpus v1.13.1
│   │   │   │   └── libc v0.2.126
│   │   │   └── once_cell v1.12.0
│   │   ├── async-io v1.6.0 (*)
│   │   ├── async-lock v2.5.0
│   │   │   └── event-listener v2.5.2
│   │   ├── crossbeam-utils v0.8.8
│   │   │   ├── cfg-if v1.0.0
│   │   │   └── lazy_static v1.4.0
│   │   ├── futures-core v0.3.21
│   │   ├── futures-io v0.3.21
│   │   ├── futures-lite v1.12.0 (*)
│   │   ├── kv-log-macro v1.0.7
│   │   │   └── log v0.4.17 (*)
│   │   ├── log v0.4.17 (*)
│   │   ├── memchr v2.5.0
│   │   ├── num_cpus v1.13.1 (*)
│   │   ├── once_cell v1.12.0
│   │   ├── pin-project-lite v0.2.9
│   │   ├── pin-utils v0.1.0
│   │   └── slab v0.4.6
│   ├── futures v0.3.21
│   │   ├── futures-channel v0.3.21
│   │   │   ├── futures-core v0.3.21
│   │   │   └── futures-sink v0.3.21
│   │   ├── futures-core v0.3.21
│   │   ├── futures-executor v0.3.21
│   │   │   ├── futures-core v0.3.21
│   │   │   ├── futures-task v0.3.21
│   │   │   └── futures-util v0.3.21
│   │   │       ├── futures-channel v0.3.21 (*)
│   │   │       ├── futures-core v0.3.21
│   │   │       ├── futures-io v0.3.21
│   │   │       ├── futures-macro v0.3.21 (proc-macro)
│   │   │       │   ├── proc-macro2 v1.0.39 (*)
│   │   │       │   ├── quote v1.0.18 (*)
│   │   │       │   └── syn v1.0.95 (*)
│   │   │       ├── futures-sink v0.3.21
│   │   │       ├── futures-task v0.3.21
│   │   │       ├── memchr v2.5.0
│   │   │       ├── pin-project-lite v0.2.9
│   │   │       ├── pin-utils v0.1.0
│   │   │       └── slab v0.4.6
│   │   ├── futures-io v0.3.21
│   │   ├── futures-sink v0.3.21
│   │   ├── futures-task v0.3.21
│   │   └── futures-util v0.3.21 (*)
│   ├── futures-timer v3.0.2
│   └── rstest_macros v0.13.0 (proc-macro)
│       ├── cfg-if v1.0.0
│       ├── proc-macro2 v1.0.39 (*)
│       ├── quote v1.0.18 (*)
│       └── syn v1.0.95 (*)
│       [build-dependencies]
│       └── rustc_version v0.4.0
│           └── semver v1.0.9
│   [build-dependencies]
│   └── rustc_version v0.4.0 (*)

cargo tree with v0.12.0

├── rstest v0.12.0 (proc-macro)
│   ├── cfg-if v1.0.0
│   ├── proc-macro2 v1.0.36 (*)
│   ├── quote v1.0.15 (*)
│   └── syn v1.0.86 (*)
│   [build-dependencies]
│   └── rustc_version v0.4.0
│       └── semver v1.0.6
@la10736
Copy link
Owner

la10736 commented May 24, 2022

Thank you very much for report this... Maybe async-std dependency is just an error.

futures is a real dependency and I can just make it opt-in with a feature flag for async timeouts ... but I don't like introduce a configuration complexity for the user ... but maybe I can provide a clear error message to help the user to add the correct feature flag.

I just remove the async-std dependency in this ticket but I'll open a new one to make async timeout support opt-in

@sholderbach
Copy link
Author

If you want to expose the timeout tests by default you could have it in the default features with another feature that encompasses the core functionality so one could run --no-default-features --features core (in the Cargo.toml with this) (Only necessary if other featuregates are present else just default feature definition should suffice)

@la10736
Copy link
Owner

la10736 commented Jun 19, 2022

What is missed:

  • End 2 End tests that enable/disable feature
  • Document features
  • Changelog

la10736 added a commit that referenced this issue Jun 19, 2022
la10736 added a commit that referenced this issue Jun 19, 2022
la10736 added a commit that referenced this issue Jun 19, 2022
@la10736
Copy link
Owner

la10736 commented Jun 19, 2022

Done

@la10736 la10736 closed this as completed Jun 19, 2022
@sholderbach
Copy link
Author

Awesome! Thank you very much. This should really improve the time and resource usage for running CI/test builds from scratch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants