Fork me on GitHub
#cursive
<
2023-09-06
>
dazld11:09:16

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

dazld11:09:27

on macOS, and versions:

cfleming10:09:31

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).

👍 2
dazld10:09:44

thanks for replying - i’ll double check there’s no confusion on the paths

dazld10:09:11

I understood that if the tests were in the paths for the modules, they would be available in the composition too, for the runner

cfleming10:09:55

If they’re under :paths they will be, since that’s not under an alias. But almost no-one does this.

dazld10:09:55

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

cfleming10:09:40

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.

dazld10:09:46

being able to pass on transitive aliases, at least to local modules, would be a godsend, indeed

dazld11:09:50

I had to mark the directories as “source” too, but it’s working now!

dazld11:09:09

they were marked as “test” - and I think that was interrupting them from being loaded, possibly?

cfleming22:09:20

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.

😞 2
dazld16:09:17

still better than having to open a repl per project, and try to remember which one I’m in per test

dazld16:09:25

but take your point.. what a pain