-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Look at mdbook-keeper #175
Comments
`mdbook test` does not allow code samples to reference other crates, so they must be marked as `compile_fail`; see google#175.
NOTE: `mdbook test` does not allow code samples to reference other crates, so they must be marked as `compile_fail`; see #175.
* beginning of an Async section * address review comments * Add futures page (#497) NOTE: `mdbook test` does not allow code samples to reference other crates, so they must be marked as `compile_fail`; see #175. * Add Runtimes & Tasks (#522) These concepts are closely related, and there's not much else to know about runtimes other than "they exist". This removes the bit about futures being "inert" because it doesn't really lead anywhere. * Async chapter (#524) * Add async channels chapter * Async control flow * Async pitfalls * Separate in multiple chapters + add daemon section * Merge reentering threads in blocking-executor * async_trait * Async fixes (#546) * Async: some ideas for simplifying the content (#550) * Simplify the async-await slide * Shorten futures and move it up * Add a page on Tokio * Modifications to the async section (#556) * Modifications to the async section * Remove the "Daemon" slide, as it largely duplicates the "Tasks" slide. The introduction to the "Control Flow" section mentions tasks as a kind of control flow. * Reorganize the structure in SUMMARY.md to correspond to the directory structure. * Simplify the "Pin" and "Blocking the Executor" slides with steps in the speaker notes to demonstrate / fix the issues. * Rename "join_all" to "Join". * Simplify some code samples to shorten them, and to print output rather than asserting. * Clarify speaker notes and include more "Try.." suggestions. * Be consistent about where `async` blocks are introduced (in the "Tasks" slide). * Explain `join` and `select` in prose. * Fix formatting of section-header slides. * Add a note on async trait (#558) --------- Co-authored-by: sakex <[email protected]> Co-authored-by: rbehjati <[email protected]>
This is of course a bit of an open ended issue 🙂 What I hope for is that someone will look at what
The goal would be remove the If you can get this working locally, then we can work on a updating the GitHub action which runs the tests for us on every PR. |
I started looking into this. Some issues/notes so far:
On my machine, it takes ~3min to run the tests which is pretty rough when I just want to
I intend to work on this some more. In case my work stalls out, or anyone's curious, my keeper branch has the WIP. |
Thanks @mauvealerts! That's already a very valuable analysis! For example, I had not realized that you run the tests all the time... so we would definitely only enable it on demand like we do for the |
I have something that I'm fairly happy with, when combined with all of these changes to
I have things running comparable to
|
Thanks for pushing this!
I think this should be the root of the repository, or perhaps the |
I didn't think it was possible to have both a I started updating some examples, but ran into link errors (tfpk/mdbook-keeper#9). In particular, not being able to use |
Ah, that's a clever work-around 😄 However, it almost suggests that
Oh, I see... I agree that it would be important to have test coverage for all the small code snippets involving Tokio and that was also my main reason to look at |
* beginning of an Async section * address review comments * Add futures page (google#497) NOTE: `mdbook test` does not allow code samples to reference other crates, so they must be marked as `compile_fail`; see google#175. * Add Runtimes & Tasks (google#522) These concepts are closely related, and there's not much else to know about runtimes other than "they exist". This removes the bit about futures being "inert" because it doesn't really lead anywhere. * Async chapter (google#524) * Add async channels chapter * Async control flow * Async pitfalls * Separate in multiple chapters + add daemon section * Merge reentering threads in blocking-executor * async_trait * Async fixes (google#546) * Async: some ideas for simplifying the content (google#550) * Simplify the async-await slide * Shorten futures and move it up * Add a page on Tokio * Modifications to the async section (google#556) * Modifications to the async section * Remove the "Daemon" slide, as it largely duplicates the "Tasks" slide. The introduction to the "Control Flow" section mentions tasks as a kind of control flow. * Reorganize the structure in SUMMARY.md to correspond to the directory structure. * Simplify the "Pin" and "Blocking the Executor" slides with steps in the speaker notes to demonstrate / fix the issues. * Rename "join_all" to "Join". * Simplify some code samples to shorten them, and to print output rather than asserting. * Clarify speaker notes and include more "Try.." suggestions. * Be consistent about where `async` blocks are introduced (in the "Tasks" slide). * Explain `join` and `select` in prose. * Fix formatting of section-header slides. * Add a note on async trait (google#558) --------- Co-authored-by: sakex <[email protected]> Co-authored-by: rbehjati <[email protected]>
We currently have a number of code blocks marked with
compile_fail
: this is often because they depend on third-party crates which aren't available when runningmdbook test
.We should look into using https://github.com/tfpk/mdbook-keeper/ to handle testing instead. It explicitly supports using third-party crates in code snippets.
The text was updated successfully, but these errors were encountered: