tools-deps

2024-02-04T03:46:15.362809Z

How can I make a parent module's test directory available to a child module's tests? In the child module's deps.edn, I add the coordinate using :local/root "../.." which seems to work great as far as its src is concerned. But when I try to run the child module's tests, using clojure -M:test, I get compilation errors because certain namespaces I need from the parent module aren't found. If I add :extra-paths ["../../test"] to the child module, then it works. But this is deprecated, so I presume there is a preferred alternative now that I'm unable to figure out.

favila 2024-02-04T05:07:22.298959Z

The only solution I’ve found to this (wanting to require test code from other modules’ test code) is to make a parallel set of test modules. Ie don’t use aliases for testing, make a separate test module that depends on the main module

Alex Miller (Clojure team) 2024-02-04T15:23:27.900519Z

This not really supported right now. Future idea is to allow specifying aliases in deps which would let you opt in to additional stuff on the classpath like that