# Pkg.test() vs julia --project=. test/runtests.jl

**URL:** <https://discourse.julialang.org/t/pkg-test-vs-julia-project-test-runtests-jl/85549>\
**Category:** General Usage\
**Tags:** testing\
**Created:** [August 9, 2022, 7:25pm UTC](https://discourse.julialang.org/t/pkg-test-vs-julia-project-test-runtests-jl/85549 "2022-08-09T19:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [August 9, 2022, 7:25pm UTC](https://discourse.julialang.org/t/pkg-test-vs-julia-project-test-runtests-jl/85549/1 "2022-08-09T19:25:20Z")

</div>

I have a package where `julia --project=. test/runtests.jl` shows all testss passing even after deleting the manifest and rebuilding it from scratch. But `] test` fails - and I cannot for the life of me understand how the error occurs. (because I can’t debug it interactively)

What exactly is the difference between these two approaches?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 9, 2022, 7:36pm UTC](https://discourse.julialang.org/t/pkg-test-vs-julia-project-test-runtests-jl/85549/2 "2022-08-09T19:36:08Z")

</div>

There are indeed some differences, you can see them here:

> [@Is there a difference under the hood between running code via a .jl file and running code via \`test name\_of\_pkg\`?](https://discourse.julialang.org/t/is-there-a-difference-under-the-hood-between-running-code-via-a-jl-file-and-running-code-via-test-name-of-pkg/38097):
>
> Hey all, I am running into a weird issue. I have some code which I will arbitrarily say is: function z() z = 10 z += 100 end z() # This code will work, it's just an arbitrary example. When I have the above code in a random “.jl” file and I run it, there are no issues. However, when I move the code into my “runtests.jl” file and then do test PkgName, I get an error. Is there some difference under the hood in the way the code is run usually vs the way it is run when testing a package th…

---

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [August 9, 2022, 8:05pm UTC](https://discourse.julialang.org/t/pkg-test-vs-julia-project-test-runtests-jl/85549/3 "2022-08-09T20:05:03Z")

</div>

awesome - thanks!
