tokio-rs / website

Website for the Tokio project
https://tokio.rs
MIT License
227 stars 328 forks source link

Add topic page for unit testing, pausing/resuming time, and mocking via AsyncRead/AsyncWrite #735

Closed barafael closed 5 months ago

barafael commented 7 months ago

This info would have helped me early on. Let me know if deemed useful as a topic page. Perhaps it would be interesting also to have a list of useful topic pages which should be written eventually.

Darksonn commented 7 months ago

Thank you. This is definitely useful. I'll review it soon. I'm the meantime, there are some markdown code blocks that don't compile, so there is a ci failure. You should be able to click details to see why it failed.

barafael commented 7 months ago

At least the tests are passing now. The problem was that some code blocks were related.

barafael commented 7 months ago

Unfortunately, the deployment fails because

3:50:00 PM: Error: Unknown language: `no_run` is not registered

I am using no_run because the main server loop I am including in the example indeed shall not run. Not sure, maybe I should remove it anyway as it serves only to establish some context?

Darksonn commented 5 months ago

I'm really sorry, this feel through my cracks.

You can add a hidden "if true { return; }" at the beginning of the test. (Hide lines by starting them with #.)

Other than getting CI to pass, this LGTM.

barafael commented 5 months ago

Thanks :) nice workaround!

Any topic pages that are still missing off the top of your head?

Darksonn commented 5 months ago

Any topic pages that are still missing off the top of your head?

Getting started with Axum comes to mind. @davidpdrsn thoughts?

davidpdrsn commented 5 months ago

Yeah a getting started guide for axum would be great. I don't have capacity to write something but I can help review. There is also some relevant discussion here https://github.com/tokio-rs/axum/issues/1811.