Fork me on GitHub
#calva
<
2021-10-09
>
andrii10:10:47

Hi! Can anyone help me troubleshoot test running in calva? When I open a test file (.cljc) and "Run tests for current namespace", I see my tests passing. However, when I try "Run All Tests", I get "No tests found".

pez11:10:23

Are your tests on the classpath?

andrii11:10:47

I'm not sure, how do I check it? I have a lein project with tests in "test" dir, and my project.clj has :test-paths ["test"]

andrii11:10:06

and when I run lein test it runs all tests fine

pez13:10:19

If there is a :test profile in the project, you might need to include that when you start the REPL.

andrii20:10:15

I don't have a test profile, my profile looks like :uberjar {:aot :all} . I tried selecting and unselecting it, in both cases no tests found when I run all tests

pez20:10:36

Try adding a test profile and add :paths ["test"] in there, and select it at jack-in (it sounds like you are using jack-in).

andrii21:10:50

still no luck 😞

andrii21:10:36

I added a profile :test {:paths ["test"]} ; I run jack-in, select Leiningen, then select my new test profile, REPL starts, and when I call run all tests I get no tests found

andrii21:10:23

is there a way to check the classpath?

pez22:10:00

It should probably be :source-paths, sorry. Anyway, Calva does not have a way to inspect the classpath, but probably Clojure has. Or at least Java.

andrii16:10:56

Tried with :source-paths and also :test-paths , still doesn't find the tests 😕 Did I maybe mess up with something else in the config? Here is my project.clj: https://github.com/gavr-games/kingdom-g/blob/master/engine/project.clj

pez16:10:19

See if it works with

:source-paths ["src" "test]
(On the line above :test-paths). If that works we know that this is a classpath issue and can find a better way to put tests on the classpath.

andrii16:10:05

this also didn't change anything

andrii16:10:15

but I have another clue 🙂

andrii17:10:08

when I changed one test file from .cljc to .clj, "run all tests" is now finding it

pez17:10:41

Interesting. Please file an issue.