Skip to content

mdbook test fails #79

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

Open
Raymi306 opened this issue Mar 15, 2025 · 1 comment
Open

mdbook test fails #79

Raymi306 opened this issue Mar 15, 2025 · 1 comment

Comments

@Raymi306
Copy link
Contributor

From the README:

To preview your changes locally:

cargo install mdbook --version "^0.4" --force
mdbook build --open
mdbook test
$ mdbook test

. . .

Couldn't compile the test.

failures:
    update-0.8.md - Updating_to_0_8::Core_features::_::_no_longer_implements_ (line 48)
    update-0.8.md - Updating_to_0_8::Core_features::_::_no_longer_implements_ (line 55)
    update-0.8.md - Updating_to_0_8::Distributions (line 124)
    update-0.8.md - Updating_to_0_8::Distributions (line 133)
    update-0.8.md - Updating_to_0_8::Distributions (line 164)
    update-0.8.md - Updating_to_0_8::Distributions (line 169)

test result: FAILED. 0 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s

. . .
@dhardy
Copy link
Member

dhardy commented Mar 16, 2025

Yes, mdbook fails to resolve dependencies:

---- quick-start.md - Quick_start::Fixed_seed_RNGs (line 84) stdout ----
error[E0463]: can't find crate for `rand`
 --> quick-start.md:85:1
  |
2 | extern crate rand;
  | ^^^^^^^^^^^^^^^^^^ can't find crate

error[E0463]: can't find crate for `rand_chacha`
 --> quick-start.md:86:1
  |
3 | extern crate rand_chacha;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error[E0432]: unresolved import `rand_0_5`
 --> update-0.5.md:78:5
  |
3 | use rand_0_5::{ChaChaRng, FromEntropy};
  |     ^^^^^^^^ you might be missing crate `rand_0_5`
  |
help: consider importing the `rand_0_5` crate
  |
2 + extern crate rand_0_5;
  |

It's not easy to solve properly; mdbook needs its own Cargo.toml probably. See e.g. rust-lang/mdBook#394.

We do have a work-around however:

cd tests
./generate.sh
cargo test

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