This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-06
Channels
- # announcements (14)
- # babashka (12)
- # beginners (61)
- # biff (2)
- # calva (16)
- # clj-kondo (22)
- # cljdoc (7)
- # clojure (131)
- # clojure-europe (52)
- # clojure-losangeles (9)
- # clojure-norway (54)
- # clojure-spec (5)
- # clojure-uk (4)
- # clojurescript (18)
- # cursive (14)
- # datomic (19)
- # deps-new (14)
- # emacs (8)
- # events (7)
- # fulcro (6)
- # graphql (3)
- # hyperfiddle (42)
- # instaparse (5)
- # lsp (10)
- # malli (21)
- # nbb (1)
- # off-topic (3)
- # pathom (3)
- # polylith (7)
- # reagent (14)
- # releases (2)
hello people! I had a quick search, but nothing jumped out, so asking here: I have a monorepo project, with several modules inside it. Each module has their own tests, and there’s one module that “composes” the other modules into a local dev stack.
I’d like to be able to use cursive’s test runner for the tests inside each module, when running a repl from the local dev module, but it keeps saying “no namespace” when trying to execute the test-ns. I’ve tried aliases (but I understand they aren’t transitively applied to local dependencies) and including the test
folder in src paths, but neither works. Is there something I’m missing?
Structure is like this:
• Core
◦ src
◦ test
• API
◦ src
◦ test
• worker
◦ src
◦ test
• Local
◦ local root deps to core, api and worker
So the no namespace thing is weird, and I’m not sure what would be causing that. But in general, since aliases are not transitive in deps, those tests won’t be available to the root module unless they’re in :paths
in the dependency (not :extra-paths
, like :test
uses).
I understood that if the tests were in the paths for the modules, they would be available in the composition too, for the runner
If they’re under :paths
they will be, since that’s not under an alias. But almost no-one does this.
yup, i’d prefer not to put them there, but for this use case, having to open a repl per module to run the tests in them is quite dull
Absolutely. Non-transitive aliases is my least favourite deps feature. I’m sure there are tradeoffs I’m not aware of, but I am aware of the pain points.
being able to pass on transitive aliases, at least to local modules, would be a godsend, indeed
they were marked as “test” - and I think that was interrupting them from being loaded, possibly?
The problem is that marking them as source in the IDE is a temporary change, that will be overwritten next time you sync your project.