Skip to content
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

Doctests as part of travis #15815

Closed
vchuravy opened this issue Apr 9, 2016 · 8 comments
Closed

Doctests as part of travis #15815

vchuravy opened this issue Apr 9, 2016 · 8 comments
Labels
docsystem The documentation building system test This change adds or pertains to unit tests

Comments

@vchuravy
Copy link
Member

vchuravy commented Apr 9, 2016

Doctests are part of the documentation and having them run automatically on travis, would ensure that the Julia documentation is kept up to date and consistent. Additionally more tests are always helpful and #15753 exposed a few regressions.

After #15753 all doctests are functional again and we could enable them for testing. While working on that PR I noticed that there is one annoying property of the doctest. They may spuriously fail when linenumbers change. This can be solved by replacing the linenumbers in the doctest with .... Any other changes will still trigger a failure.

As an example see 19d4431

@tkelman
Copy link
Contributor

tkelman commented Apr 9, 2016

This will be yet another way in which travis can fail if people push changes straight to master without testing first, but I think it would be worth it.

For simple stuff like line numbers, I wonder if we couldn't make JuliaDoc (edit: or genstdlib) fill them in automatically? This may be easier for the doctests that have already been migrated to inline julia docstrings.

@yuyichao
Copy link
Contributor

yuyichao commented Apr 9, 2016

It'll be nice if the backtrace can be ignored .... As we improve the backtrace for inline functions the backtrace is likely going to be more and more sensitive to subtle changes that can affect line numbers or inlining decisions.

@vchuravy
Copy link
Member Author

We probably could make JuliaDoc less sensitive to line-number changes, or alternativly we encourage the usage of .... As far as I can tell it is very sparsily used in the doctests. One example of where it is well used is: adce356#diff-c9107d78b307be1cab2363ee98efe06bR27.

@tkelman
Copy link
Contributor

tkelman commented Apr 10, 2016

I actually like having a full detailed backtrace for release docs, but it is overkill while in dev.

@kshyatt kshyatt added test This change adds or pertains to unit tests docsystem The documentation building system labels May 9, 2016
@omus
Copy link
Member

omus commented Jun 25, 2016

While working on #17106 I discovered some good reasons not to run doctests in dev (release may still be fine):

The doctest julia> methods(+) would sometimes print the methods in a different order resulting in the doctest to fail.

If we were to run the doctests as part of the Travis we would have to limit them to run on only 64-bit as integer literals reveal their types in exceptions :

julia> bar(a,b,x::Vararg{Any,2}) = (a,b,x);

julia> bar(1,2,3)
ERROR: MethodError: no method matching bar(::Int64, ::Int64, ::Int64)
...

I would however like to see some automation with the doctest system to ensure that the manual is kept up to date.

@KristofferC
Copy link
Sponsor Member

Closing in favor of #15815

@tkelman
Copy link
Contributor

tkelman commented Jan 26, 2017

this is 15815

@tkelman tkelman reopened this Jan 26, 2017
@KristofferC
Copy link
Sponsor Member

Derp, #19528.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system test This change adds or pertains to unit tests
Projects
None yet
Development

No branches or pull requests

6 participants