Skip to content

Exit with a nonzero status if we get an error #161

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

Merged
merged 1 commit into from
Aug 6, 2016

Conversation

carols10cents
Copy link
Member

A branch of the book had a code example that failed with mdbook test, but travis reported a success. This is because the exit status of mdbook test (and other commands) is still 0 even when there are errors.

I made a little repo that has an example to test with, but the book-example in this repo also currently has an error with mdbook test 😱

Before this patch, if I run mdbook test on those, I get an exit status of 0 when I expect to get nonzero. After this patch, I get the nonzero exit status that I expected (I went with 101 because that's what rustdoc --test returns if it fails), and I continue to get an exit status of 0 when running mdbook test on a book that passes its tests.

This does affect all commands. I'm not sure if others were already exiting as expected when encountering errors or not. It looks like watch might.

I didn't see any automated tests that actually run the binaries-- please point me to the appropriate place to add tests if I missed them!

This is especially important when mdbook is used with CI.
@azerupi azerupi merged commit 9732a3b into rust-lang:master Aug 6, 2016
@azerupi
Copy link
Contributor

azerupi commented Aug 6, 2016

Thanks! This was indeed a huge oversight.

I didn't see any automated tests that actually run the binaries

No, I have not much experience with writing good tests and it's an area that is definitely lacking in this project. At some point I should take the time to write a good test suite. But in the mean time, if you feel like adding a test for this, I'm not gonna stop you 😉

@carols10cents carols10cents deleted the exit-status branch August 7, 2016 01:08
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