# Testing a Package: Warning about test dependency

**URL:** https://discourse.julialang.org/t/testing-a-package-warning-about-test-dependency/64363
**Category:** General Usage
**Tags:** package
**Created:** [July 9, 2021, 3:53pm UTC](https://discourse.julialang.org/t/testing-a-package-warning-about-test-dependency/64363 "2021-07-09T15:53:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [July 9, 2021, 3:53pm UTC](https://discourse.julialang.org/t/testing-a-package-warning-about-test-dependency/64363/1 "2021-07-09T15:53:08Z")

</div>

Hi,

I am working on a package ([GitHub - v-i-s-h/Runner.jl: Provides `@runit` macro for running scripts with commandline arguments from REPL](https://github.com/v-i-s-h/Runner.jl)) and also wrote some test cases.  
When I tried to test it through `pkg > test`, I am getting the following warning:

```nohighlight
┌ Warning: Package Runner does not have Test in its dependencies:
│ - If you have Runner checked out for development and have
│ added Test as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Runner
└ Loading Test into Runner from project dependency, future warnings for Runner are suppressed.

```

Even though all tests are passing, I am unable to resolve this warning. I tried using `resolve`, but did help.

**Background** :  
For testing purpose alone, I use two more packages

```julia
- Test
- ArgParse

```

and these are added in `tests/Project.toml`.

The issue is, I have not included it as dependency in root level `Project.toml`. If I add these two in root level `Project.toml`, the issue goes away. (I have added them as `[extras]` in `Project.toml` though.) But I do not want to list these as the package dependencies since it is not used by the package itself. I thought `tests/Project.toml` is enough for managing test dependencies, but it appears I am missing something.

**Reproduce**

```bash
$ git clone https://github.com/v-i-s-h/Runner.jl.git
$ cd Runner.jl
$ julia --project=.
$ (Runner) pkg> test

```

---

<div class="post-metadata">

### Author: ![StevenWhitaker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevenwhitaker/32/9749_2.png) [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)
#### Post date: [July 9, 2021, 5:05pm UTC](https://discourse.julialang.org/t/testing-a-package-warning-about-test-dependency/64363/2 "2021-07-09T17:05:35Z")

</div>

I’m not super familiar with macros, but it looks like your macro is evaluating the code in the context of the module in which the macro was defined, not in the calling context. (Hence the need for `@runit common.jl` to avoid errors in the tests.) Maybe it’s related to [hygiene](https://docs.julialang.org/en/v1/manual/metaprogramming/#Hygiene)?

I don’t know how to resolve the issue, though, so someone with more macro experience should probably also weigh in.
