Faster testing of package

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?

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

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

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

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

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

+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.

1 Like