Fork me on GitHub
#calva
<
2022-04-23
>
NickName18:04:53

This is what I get when trying to run tests. Any ideas what might be causing it?

; Evaluating file: core_test.clj
#'csvdb.core-test/select-test
; Running tests for csvdb.core-test...
; The server does not recognize or cannot perform the 'test-var-query' operation
This particular test looks like this https://pastebin.com/USDuWPCu

pez19:04:53

How did you start the repl?

NickName19:04:25

By jack-in (`Ctrl-Alt-C Ctrl-Alt-J`)

Marc O'Morain22:04:53

This error means that the cider nrepl “test” middleware is not loaded.

pez07:04:05

Is it a Leiningen project?

NickName20:04:29

Sorry for late response. It is a Leiningen project. Regarding test middleware not being loaded, I actually don't know what does it mean besides something related to CIDER. Should I add something to project settings or maybe tweak some VS Code parameters?

pez20:04:15

Check if your project has some cider-nrepl and/or nrepl dependency. If so, try with removing those and see if it works. test-var-quary is a new-ish op. So if the project defines some old-ish nrepl and/or cider-nrepl dependencies, maybe they override what Calva specifies on the command line (it is strange why it should, but Leiningen does behave a bit strange around this at times).

NickName23:04:48

I guess it really has something to do with project settings. This project is from 2014 tutorial and probably dependencies there are too outdated (though nothing related to cider-nrepl or repl in project.clj ). Anyway, I just checked tests in newly scaffolded project and everything works fine. Thanks for helping me out! And thanks for Calva, I really like playing with it and everything works so smoothly:)

🙏 1
pez06:04:23

Thanks! I’m surprised about no nrepl deps. But I vaguely remember something about Leiningen bundling nrepl. Which version of Leiningen are you using?

NickName12:04:28

Oh, now I see. I was using Clojure 1.7.0 in that project and didn't pay attention to terminal output which said:

Warning: cider-nrepl requires Clojure 1.8 or greater.
Warning: cider-nrepl will not be included in your project.
I changed it to 1.8.0 and now tests work there too. Many thanks to you good sir!

pez13:04:15

Great! Thanks for sharing the resolution. I'm tucking under my belt. We should probably document it somewhere as well.

🙌 1