# How to test with multiple versions of a dependency in CI

**URL:** <https://discourse.julialang.org/t/how-to-test-with-multiple-versions-of-a-dependency-in-ci/114761>\
**Category:** General Usage\
**Tags:** question, package, testing, ci, dependencies\
**Created:** [May 27, 2024, 3:29am UTC](https://discourse.julialang.org/t/how-to-test-with-multiple-versions-of-a-dependency-in-ci/114761 "2024-05-27T03:29:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 27, 2024, 8:56am UTC](https://discourse.julialang.org/t/how-to-test-with-multiple-versions-of-a-dependency-in-ci/114761/2 "2024-05-27T08:56:02Z")

</div>

I had a similar problem with DifferentiationInterface.jl, where I need to test compatibility with a dozen different autodiff packages and pairs thereof. I solved it by creating several test “groups”, defined by an environment variable.  
This environment variable is set in CI (possibly using entries from the workflow matrix), and then queried in `runtests.jl`. You can take a look at the following files: [`Test.yml`](https://github.com/gdalle/DifferentiationInterface.jl/blob/main/.github/workflows/Test.yml), [`runtests.jl`](https://github.com/gdalle/DifferentiationInterface.jl/blob/main/DifferentiationInterface/test/runtests.jl).

Also related:

- [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)
- [Different test dependencies for different Julia versions?](https://discourse.julialang.org/t/different-test-dependencies-for-different-julia-versions/113767)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-test-with-multiple-versions-of-a-dependency-in-ci/114761)._
