Testing a Package: Warning about test dependency


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

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

For testing purpose alone, I use two more packages

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


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

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?

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