-
Notifications
You must be signed in to change notification settings - Fork 626
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
Provide a crate with utilities for testing futures based code #1169
Comments
I just threw together a start on a crate to provide something more useful for discussion, it trys to implement something around the second bullet above: https://github.com/Nemo157/futures-rs/tree/testing-utilities |
I think everything in |
Heh, that’s basically exactly what I implemented on that branch 😄, oh well, it was a good chance for me to finally look at how the 0.3 waker system fits together. |
I agree that we should aim to provide first party testing utilities. Testing is important and every respectable library needs to do it. We can avoid a lot of work duplication throughout the ecosystem if we provide common utilities. And the fewer project specific utilities a project uses, the easier it is of course for others to get started and contribute. Furthermore, we can write a guide that explains how it's done. |
Cool, leads are on board 😁, I’ll take a look at what’s in the futures test support currently and try and pull out a first pass on a crate this weekend. |
Do we want to put this into |
IMO separate crate that’s not in the facade to be used as a dev-dependency |
I agree |
Another idea I just had, provide an EDIT: Added to top post, feel free to expand the list with new ideas that come in, I'm gonna advertise this as a brainstorm issue in the blog post about the crate. |
|
I'm slightly less sure about this idea-- I'd think most "real-ish" futures written using async/await syntax wouldn't work with this sort of thing because they'd interact with executor specific primitives that wouldn't interoperate with |
That’s a good point. First thought is to make the executor configurable in the attribute (where executor in this case simply means |
Just had another thought: https://crates.io/crates/futures-test @carllerche do you have any plans for this crate name? |
The plan has been to release this once I need to: https://github.com/carllerche/better-future/tree/master/futures-test It is currently being depended on via git from tower, and other repos. |
@carllerche I don't suppose you'd want to use 0.1.* versions for that crate and allow using 0.3.* for the crate we have here once @MajorBreakfast, @cramertj any ideas for an alternative name? I'd suggest not publishing this crate with the |
|
|
I can hand off |
|
Related to rustasync/team#38
I think it's worth
futures-rs
itself providing a crate with basic test utilities. Over time I would expect more complex utilities to be provided by crates out of tree, but having something available around the time of the 0.3 release for at least basic testing would be very useful for the ecosystem.Ideas suggested:
Context
/Waker
/Spawn
implementationsPoll::Pending
sometimes#[async_test]
proc-macroThe text was updated successfully, but these errors were encountered: