Skip to content

Switch on testing for the book; fix #6 #71

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

Closed
wants to merge 3 commits into from
Closed

Switch on testing for the book; fix #6 #71

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 17, 2019

Run the tests with the following:

cargo build    # first build async_std
mdbook test -L ./target/debug/deps docs

The -L flag is needed so that external crates can be resolved in the tests.

@skade
Copy link
Collaborator

skade commented Aug 18, 2019

Wow, thanks already for that :).

@ghost ghost marked this pull request as ready for review August 18, 2019 23:39
@ghost
Copy link
Author

ghost commented Aug 18, 2019

I haven't tested the changes to the travis build but otherwise I think this is ready.

@skade skade mentioned this pull request Aug 19, 2019
@skade
Copy link
Collaborator

skade commented Aug 19, 2019

This will fail ;). What's missing is a before_script similar to here: https://rust-lang-nursery.github.io/mdBook/continuous-integration.html

@ghost
Copy link
Author

ghost commented Aug 19, 2019

I'm not sure how to fix this latest error from mdbook test about multiple matching crates for async_std. I saw something similar locally but only once and it seemed to resolve itself. Any ideas? By the way, feel free to make whatever changes needed to this, stylistically or otherwise.

@ghost
Copy link
Author

ghost commented Aug 20, 2019

Note that this fixes #89.

- cargo check --all --benches --bins --examples --tests
- cargo test --all
- if ![[ -n "$BUILD_BOOK" ]]; then cargo check --all --benches --bins --examples --tests && cargo test --all; fi
- if [[ -n "$BUILD_BOOK" ]]; then cargo test --all --benches --bins --examples --tests; fi
Copy link
Author

@ghost ghost Aug 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had to modify the travis config to where, when the book should be built, we don't run cargo check but instead just run cargo test.

This might cause ci to not fail as quickly on the linux build but the problem is that running cargo check followed by cargo test produces two entries for async_std in ./target/debug/deps which then causes mdbook test to fail when trying to resolve extern crate async_std.

I don't know of another way to fix that issue. If this is an acceptable workaround then I think this PR is good to go.

@skade
Copy link
Collaborator

skade commented Aug 21, 2019

This needs to be updated to remove all uses of #[feature(async_await)]

@ghost
Copy link
Author

ghost commented Aug 21, 2019

I've removed the #[feature(async_await)] and squashed some of the commits.

@ghost
Copy link
Author

ghost commented Aug 23, 2019

I've rebased again and fixed the latest set of merge conflicts. /cc @skade @stjepang

ghost referenced this pull request Aug 24, 2019
Added missing `spawn_and_log_error` function declaration
@ghost ghost closed this Aug 24, 2019
@ghost ghost deleted the book-test branch August 24, 2019 01:16
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants