# How to use local version of test dependency?

**URL:** <https://discourse.julialang.org/t/how-to-use-local-version-of-test-dependency/117833>\
**Category:** General Usage\
**Tags:** testing, pkg, ci\
**Created:** [August 5, 2024, 8:42am UTC](https://discourse.julialang.org/t/how-to-use-local-version-of-test-dependency/117833 "2024-08-05T08:42:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [August 5, 2024, 8:42am UTC](https://discourse.julialang.org/t/how-to-use-local-version-of-test-dependency/117833/1 "2024-08-05T08:42:30Z")

</div>

I have a monorepo with two packages side by side: DifferentiationInterface.jl (DI) and DifferentiationInterfaceTest.jl (DIT). The tests of DI require DIT, and when I run CI, I want to be sure to always install the local version of DIT from the repo, not the stable version from the registry.

The problem I see is that I cannot access the test environment of DI before running `Pkg.test`.

- Sofar I have been doing `Pkg` operations in the DI `runtests.jl` file, which is very ugly.
- I tried doing those in the CI workflow before the testing step, but I end up adding DIT as a dependency of the DI package itself, which is not what I want and makes Aqua.jl angry ([Put local installation in CI by gdalle · Pull Request #402 · gdalle/DifferentiationInterface.jl · GitHub](https://github.com/gdalle/DifferentiationInterface.jl/pull/402))
- I know that I could create a `test/Project.toml` and the associated `test/Manifest.toml` then use `Pkg.test(allow_reresolve=false)`, but this way of specifying test dependencies is rather brittle and I’ve been steering clear sofar (["cannot merge projects" error · Issue #1585 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/1585)).

Has anyone encountered this problem before?
