# Confused by pkg\> test behavior

**URL:** https://discourse.julialang.org/t/confused-by-pkg-test-behavior/35500
**Category:** Package Management
**Tags:** pkg
**Created:** [March 4, 2020, 3:25am UTC](https://discourse.julialang.org/t/confused-by-pkg-test-behavior/35500 "2020-03-04T03:25:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pdubya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdubya/32/394_2.png) [@pdubya](https://discourse.julialang.org/u/pdubya)
#### Post date: [March 4, 2020, 3:25am UTC](https://discourse.julialang.org/t/confused-by-pkg-test-behavior/35500/1 "2020-03-04T03:25:59Z")

</div>

I’ve set up a basic package following the description in the pkg docs. When I run pkg\> test I get errors about missing packages that are dependencies of the target package.

```julia
(Hello) pkg> test
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `~/Projects/juliatest/Hello/Project.toml`
 [no changes]
   Testing Hello
 Resolving package versions...
  Updating `/private/var/folders/hp/xqmbhy491t5gbm1gt0ht7nh00000gn/T/jl_LKqhcx/Project.toml`
  [30038a6a] + Hello v0.1.0 [`~/Projects/juliatest/Hello`]
  [8dfed614] + Test 
  Updating `/private/var/folders/hp/xqmbhy491t5gbm1gt0ht7nh00000gn/T/jl_LKqhcx/Manifest.toml`
  [30038a6a] + Hello v0.1.0 [`~/Projects/juliatest/Hello`]
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 
[ Info: Running Sandbox
    Status `/private/var/folders/hp/xqmbhy491t5gbm1gt0ht7nh00000gn/T/jl_LKqhcx/Project.toml`
  [30038a6a] Hello v0.1.0 [`~/Projects/juliatest/Hello`]
  [8dfed614] Test 
ERROR: LoadError: ArgumentError: Package Random not found in current path:
- Run `import Pkg; Pkg.add("Random")` to install the Random package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:887
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1105
 [4] include(::Module, ::String) at ./Base.jl:31
 [5] include(::String) at ./client.jl:424
 [6] top-level scope at none:6
in expression starting at /Users/pjw/Projects/juliatest/Hello/test/runtests.jl:5
ERROR: Package Hello errored during testing

```

looks like Random is being included into the environment, but not found when the package executes. I can fix by adding Random to test/Project.toml, but don’t think that is the intended behavior. Am I missing something?

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [March 4, 2020, 4:09am UTC](https://discourse.julialang.org/t/confused-by-pkg-test-behavior/35500/2 "2020-03-04T04:09:17Z")

</div>

maybe you need to make `Random` a `dep` of your package `Hello`

---

<div class="post-metadata">

### Author: ![pdubya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdubya/32/394_2.png) [@pdubya](https://discourse.julialang.org/u/pdubya)
#### Post date: [March 4, 2020, 4:19am UTC](https://discourse.julialang.org/t/confused-by-pkg-test-behavior/35500/3 "2020-03-04T04:19:29Z")

</div>

thanks not sure if I had that in before. Just confirmed it is there now. Still get same behavior though

```julia
(Hello) pkg> status
Project Hello v0.1.0
    Status `~/Projects/juliatest/Hello/Project.toml`
  [9a3f8284] Random
(Hello) pkg> test
   Testing Hello
 Resolving package versions...
  Updating `/private/var/folders/hp/xqmbhy491t5gbm1gt0ht7nh00000gn/T/jl_ByAGEJ/Project.toml`
  [30038a6a] + Hello v0.1.0 [`~/Projects/juliatest/Hello`]
  [8dfed614] + Test 
  Updating `/private/var/folders/hp/xqmbhy491t5gbm1gt0ht7nh00000gn/T/jl_ByAGEJ/Manifest.toml`
  [30038a6a] + Hello v0.1.0 [`~/Projects/juliatest/Hello`]
  [2a0f44e3] + Base64 
...
ERROR: LoadError: ArgumentError: Package Random not found in current path:
- Run `import Pkg; Pkg.add("Random")` to install the Random package.

```
