Faster testing of package


#1

It seems like Pkg.test is slow because I am using some bigger packages in my own like JuMP and Ipopt.
Is it possible to include them before so these unchanged packages don’t get compiled every time I run my tests?
I tried to use using JuMP, Ipopt before running Pkg.test() but then the modules are unknown.
That probably makes sense because Pkg.test should run in its own container.
Whatever… is there any way?


#2

include("your_package/test/runtest.jl")? That’ll run the tests in the current session.


#3

But that doesn’t recompile my package, right? I think this will use the old version if I change something.


#4

It will recompile the package if you run it in a new Julia session.


#5

Yes but then I have no advantage because everything will be compiled then, right?


#6

Right, so either reload your package, or use Revise.jl


#7

+1 to Revise.jl

Only packages that changed will be recompiled. Also, one thing that can contribute to slow Pkg.test is if you have a test/REQUIRE file as then it will always resolve package dependency on testing.