# Faster testing of package

**URL:** <https://discourse.julialang.org/t/faster-testing-of-package/6787>\
**Category:** New to Julia\
**Created:** [October 30, 2017, 10:05pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787 "2017-10-30T22:05:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wikunia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wikunia/32/2180_2.png) [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Post date:** [October 30, 2017, 10:05pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/1 "2017-10-30T22:05:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [October 30, 2017, 10:31pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/2 "2017-10-30T22:31:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wikunia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wikunia/32/2180_2.png) [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Post date:** [October 30, 2017, 10:37pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/3 "2017-10-30T22:37:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 30, 2017, 11:22pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/4 "2017-10-30T23:22:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wikunia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wikunia/32/2180_2.png) [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Post date:** [October 30, 2017, 11:31pm UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/5 "2017-10-30T23:31:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [October 31, 2017, 12:35am UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/6 "2017-10-31T00:35:37Z")

</div>

Right, so either `reload` your package, or use [Revise.jl](https://github.com/timholy/Revise.jl)

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [October 31, 2017, 6:44am UTC](https://discourse.julialang.org/t/faster-testing-of-package/6787/7 "2017-10-31T06:44:08Z")

</div>

+1 to Revise.jl

> [@Wikunia](#):
>
> everything will be compiled then

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.
