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

Doctest ALL the things #20274

Closed
37 of 38 tasks
KristofferC opened this issue Jan 27, 2017 · 27 comments · Fixed by #20612
Closed
37 of 38 tasks

Doctest ALL the things #20274

KristofferC opened this issue Jan 27, 2017 · 27 comments · Fixed by #20612
Labels
domain:docs This change adds or pertains to documentation

Comments

@KristofferC
Copy link
Sponsor Member

KristofferC commented Jan 27, 2017

This is a list of all files that need doctests in the manual. If you have a PR in progress to doctest a file please claim it here. This is in order for people not to do double work. If there is a file that you know of that is fully doctests, please mention it as well.

cc @fredrikekre.

@KristofferC KristofferC added the domain:docs This change adds or pertains to documentation label Jan 27, 2017
@fredrikekre
Copy link
Member

#20183 covers:

  • Introduction
  • Getting Started
  • Variables
  • Integers and Floating-Point Numbers
  • Mathematical Operations and Elementary Functions
  • Complex and Rational Number
  • Strings

#20201 covers:

  • Functions

#20202 covers:

  • Control Flow
  • Scope of Variables

#20224 covers:

  • Types
  • Methods

@kshyatt
Copy link
Contributor

kshyatt commented Jan 27, 2017

The Linear Algebra section of the manual is already doctested, in #19733

@fredrikekre
Copy link
Member

#20125 was Multidimensional Arrays

@kshyatt
Copy link
Contributor

kshyatt commented Jan 27, 2017

Note that many of these files could certainly use more doctested examples, even if the conversion of existing ones is complete!

@KristofferC
Copy link
Sponsor Member Author

Yeah that is always the case. This issue is mostly to make sure the current stuff is correct.

@fredrikekre
Copy link
Member

Interfaces: #20287

@fredrikekre
Copy link
Member

#20288
Let's just start over :p

@KristofferC
Copy link
Sponsor Member Author

Rip.

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

Good thing you only yolo once... Is there an easy way to see what doc tests were affected, or is it just brute force going through them all on the latest master?

@KristofferC
Copy link
Sponsor Member Author

just run the tests and go through them I think

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

Okay... Don't know if any of you have started, but I'm working my way though the spaces.

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

Documenter: populating indices.
ERROR: LoadError: `makedocs` encountered an error. Terminating build

Is this expected during make -C doc doctest ?

@KristofferC
Copy link
Sponsor Member Author

Hmm.. I haven't seen it before.

@tkelman
Copy link
Contributor

tkelman commented Feb 2, 2017

I'm not seeing that locally? nevermind I do, but only after it has run most or all of the doctests - I'm guessing that might be expected if the doctests are failing?

We should think about adding a doctest mode to documenter that outputs valid patch files you could just pipe to git apply. You'd want to manually review the change before committing it, but would be good to automate mechanical fixes like this.

@KristofferC
Copy link
Sponsor Member Author

That'd be pretty cool!

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

I'm not seeing that locally?

I'll try to checkout master to see if it was any of my changes that caused it.

We should think about adding a doctest mode to documenter that outputs valid patch files you could just pipe to git apply. You'd want to manually review the change before committing it, but would be good to automate mechanical fixes like this.

good idea

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

Hm, this is the full error

Documenter: populating indices.
ERROR: LoadError: `makedocs` encountered an error. Terminating build
Stacktrace:
 [1] runner(::Type{Documenter.Builder.RenderDocument}, ::Documenter.Documents.Document) at /home/pkm/julia/julia/doc/deps/v0.6/Documenter/src/Builder.jl:202
 [2] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at /home/pkm/julia/julia/doc/deps/v0.6/Documenter/src/Selectors.jl:164
 [3] cd(::Documenter.##2#3{Documenter.Documents.Document}, ::String) at ./file.jl:69
 [4] #makedocs#1(::Bool, ::Array{Any,1}, ::Function) at /home/pkm/julia/julia/doc/deps/v0.6/Documenter/src/Documenter.jl:159
 [5] (::Documenter.#kw##makedocs)(::Array{Any,1}, ::Documenter.#makedocs) at ./<missing>:0
 [6] include_from_node1(::String) at ./loading.jl:539
 [7] include(::String) at ./sysimg.jl:14
 [8] process_options(::Base.JLOptions) at ./client.jl:304
 [9] _start() at ./client.jl:370
while loading /home/pkm/julia/julia/doc/make.jl, in expression starting on line 115
Makefile:54: recipe for target 'doctest' failed
make: *** [doctest] Error 1
make: Leaving directory '/home/pkm/julia/julia/doc'

is this simply because there were doctest errors?

@StefanKarpinski
Copy link
Sponsor Member

Wouldn't it be easier to just run all the doctests through julia and replace the output in the docs? Then doing git diff would show you the changes. Needing to do git apply to apply them seems like an unnecessary complication. Then the script that does that doesn't need to know anything about git or diffs.

@KristofferC
Copy link
Sponsor Member Author

That would remove the error checking part from the doctests I guess but perhaps it's fine to say that tests should just be in CI

@tkelman
Copy link
Contributor

tkelman commented Feb 2, 2017

I wouldn't want running the doctests to write changes to base sources by default, what if you build from a release tarball and do that.

@StefanKarpinski
Copy link
Sponsor Member

Obviously not, but it could be a different make target.

@KristofferC
Copy link
Sponsor Member Author

@pkofod yes, if you run in strict mode then that will happen if there are any errors in the build

@KristofferC
Copy link
Sponsor Member Author

For now I suggest working locally with #20288 reverted, and when someone (maybe @pkofod) makes a PR that fixes all from that we all switch over. Else everything will conflict and it will be a mess.

@pkofod
Copy link
Contributor

pkofod commented Feb 2, 2017

For now I suggest working locally with #20288 reverted, and when someone (maybe @pkofod) makes a PR that fixes all from that we all switch over. Else everything will conflict and it will be a mess.

I am on it, I've just been AFK for a while. I'll make a PR when they're adjusted. (edit is fixed in #20417 by vtjnash)

@ararslan
Copy link
Member

ararslan commented Feb 2, 2017

I just want to say thank you all so much for doing this, it's fantastic! 💯

@KristofferC
Copy link
Sponsor Member Author

Nice job broses and sises.

@KristofferC
Copy link
Sponsor Member Author

Actually, #20297 is still open. Oh well. I close this anyway :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants