Fork me on GitHub
#cider
<
2023-02-03
>
mister_m14:02:28

quick q about loading files after a cider-jack-in - I am trying to C-c C-k / "load buffer" in a file with a number of test cases which is require-ing a number of dependencies from elsewhere in my project. Naturally this does not work, as these dependencies have not been loaded into the new REPL session. What's the shortest path to load only required dependencies so I can execute tests in the current test file? Do I need to just run cider-load-all-project-ns to load all namespaces in the project? Is there a reason or a gotcha for why I shouldn't do that whenever I start a session?

dpsutton14:02:51

Why doesn’t this work? Every file should be loadable. It will just require it’s own dependencies

mister_m14:02:35

The immediate failure I got was an FileNotFoundException for a dependency which ends in an unhandled CompilerException. I think this could be caused by a missing alias (I need to set up dir-locals). I'll report back if I can't resolve the problem. It doesn't appear that it is able to find a dependency on the classpath though which makes me think that not loading my "test" alias which defines the :extra-paths field where my tests live may be causing C-c C-k to fail

dpsutton14:02:38

it can’t find token.clj. Are you requiring a namespace called token?

dpsutton14:02:52

presumably you are in a test file at test/token_test.clj

mister_m14:02:58

Correct in both deductions.

dpsutton14:02:26

so nothing cider related really. type in the repl (require 'token) if that fails nothing CIDER can do

dpsutton14:02:37

and your classpaths aren’t set correctly

mister_m14:02:13

I'll figure out how to get them set up properly. Thanks @U11BV7MTK

dpsutton14:02:39

my suggestion is to remove CIDER until it works

dpsutton14:02:04

clj from a command line. (require 'token-test) (clojure.test/run-tests 'token-test)

dpsutton14:02:10

once that works it should work in CIDER

mister_m14:02:31

I'll take your advice and start there

mister_m14:02:08

it was a bad path in the :paths attribute of my deps.edn ! I must not have noticed because I had loaded buffers one at a time when creating them the other day. Thanks for the direction

👍 4