JuliaInterop / NBInclude.jl

import code from IJulia Jupyter notebooks into Julia programs
Other
118 stars 17 forks source link

Using NBInclude for testing #4

Closed cstjean closed 7 years ago

cstjean commented 7 years ago

I've started using NBInclude for regression testing and it works well so far, since @test is interpreted normally, but I'd like to make a few improvements to nbinclude. NBInclude is currently quite lean and minimal, so the first question is whether you're interested in this at all, or if I should fork it into NBTesting.jl. I'm considering:

What do you think? I can do the first and third without modifying NBinclude, so if you OK the second, I could just write the rest as a convenience function on my side.

stevengj commented 7 years ago

I'm skeptical of these; I'd prefer to keep the semantics similar to include. And, as you say, you can already skip #NBSKIP cells with the regex option, but I wouldn't want to make that the default since comments aren't semantically meaningful by default.

As for status updates in long-running tests, why not just add println statements? Or maybe there should be a feature of Base.Test to display a progress meter for testsets?

cstjean commented 7 years ago

Fair enough. I'll experiment on my side.

simonbyrne commented 7 years ago

Since it is not obvious (at least, it wasn't to me) how to construct excluding regexes, it might be a good idea to add it as an example to the README. After quite a bit of googling, trial and error, I ended up using the following (if there are better ways, I would be keen to know).

r"^((?!\#NBSKIP)[\S\s])*$"
simonbyrne commented 7 years ago

Or r"^((?!\#NBSKIP).)*$"s seems to be a bit simpler.