# Different test dependencies for different Julia versions?

**URL:** <https://discourse.julialang.org/t/different-test-dependencies-for-different-julia-versions/113767>\
**Category:** Package Management\
**Tags:** testing, ci, versions\
**Created:** [May 2, 2024, 11:24pm UTC](https://discourse.julialang.org/t/different-test-dependencies-for-different-julia-versions/113767 "2024-05-02T23:24:57Z")\
**Posts on this page:** 2\
**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:** [May 2, 2024, 11:24pm UTC](https://discourse.julialang.org/t/different-test-dependencies-for-different-julia-versions/113767/1 "2024-05-02T23:24:57Z")

</div>

I want to make a package compatible with Julia 1.6, but some of my test dependencies are only compatible with Julia 1.10. How can I avoid requiring them when testing on 1.6?  
The associated tests can be put inside an `if VERSION >= v"1.10" ` but AFAICT `pkg> test` will still try to install every all the test dependencies. Is that best handled in the CI files?

Related question that I’m still curious about:

> [@How to test package with different sets of test dependencies](https://discourse.julialang.org/t/how-to-test-package-with-different-sets-of-test-dependencies/113478):
>
> Suppose for various reasons I want to test a package with two different test/Project.toml’s. These will have different packages / compat bounds and my single runtests.jl is conditional on which dependencies are loaded. Is there any streamlined / recommended way to do this? Both locally and for GitHub actions? Thanks for any suggestions.

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [May 3, 2024, 6:52am UTC](https://discourse.julialang.org/t/different-test-dependencies-for-different-julia-versions/113767/2 "2024-05-03T06:52:19Z")

</div>

In TestEnv.jl’s own tests it is managed via using `Pkg.add` within the actual source code of the tests.  
e.g

> <https://github.com/JuliaTesting/TestEnv.jl/blob/621a776ea7e67bbd928e933a075cb83123c198ec/test/activate_set.jl#L33-L34>
