Confused by pkg> test behavior

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.

(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?

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

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

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