cursive

Santiago Cabrera 2025-10-06T15:18:13.281849Z

Is there a way for the built in way of running the test under caret not load the current namespace? It looks like loading the current namespace is slower than just selecting the whole file and send that to the REPL.

onetom 2025-10-06T17:47:04.919549Z

that sounds very fishy... u can always use the little REPL input pane below the REPL output pane to just run your test function or let the test framework u r using to run it for you. i personally defined a Cursive REPL Command and bound that to a key: https://clojurians.slack.com/archives/C0744GXCJ/p1677794680000109?thread_ts=1677747617.855779&cid=C0744GXCJ in your custom REPL command definition u can choose not to load anything before evaluating whatever expression you want.

onetom 2025-10-06T17:47:51.373579Z

sounds like u must be doing some side-effect-ful operations during the loading of some of your namespaces, which your test namespace depends on

onetom 2025-10-06T17:48:32.521429Z

btw, my current REPL command expression has some timing added to it, since i shared that screenshot above:

(do (when-not (resolve 'user/focused-test) (intern 'user 'focused-test (atom nil)))
    (when (:test (meta #'~current-var)) (reset! user/focused-test '~current-var))
    (let [run (requiring-resolve 'kaocha.repl/run)]
      (if-let [t @user/focused-test]
        (do (require (symbol (namespace t)) :reload)
            (time (run t)))
        (time (run :unit :behaviour {})))))

Santiago Cabrera 2025-10-06T17:53:40.623399Z

Thanks. Yeah, that's what I do usually, but I want to reduce my personal setup to a minimum to share it more widely with others that might be newer. From this, looks like it is reloading the namespaces my current ns depends on, given that just evaluating in the REPL is faster. If it's expected for the built in way to run test to be slow, and nothing to do about it, I can go on with the custom command approach.

Santiago Cabrera 2025-10-06T17:54:02.880709Z

> that sounds very fishy... What does? Not reloading the namespace?

onetom 2025-10-06T17:55:17.592719Z

the fact that "loading a namespace" takes longer than evaling its content

Santiago Cabrera 2025-10-06T17:55:50.866009Z

Yeah. Any ideas how to find out why?

onetom 2025-10-06T17:56:47.493339Z

if u could do a quick screen share i could help, but im busy at the moment unfortunately.

onetom 2025-10-06T17:57:57.798689Z

is it a local or remote repl connection you are talking about? because depending on that, loading a namespace is not the same as evaling the source code in your editor window.

Santiago Cabrera 2025-10-06T17:59:33.660259Z

> if u could do a quick screen share i could help I'm not sure I can, sorry. I can try out later with a dummy project I can share, although it might end up not having that difference... > is it a local or remote repl connection you are talking about? Local, just used the normal nrepl flow that's setup by default.

onetom 2025-10-06T18:06:31.612729Z

if you do a (time (require 'your.slow.name-space-test :reload :verbose)), is that slow too?

Santiago Cabrera 2025-10-06T18:26:30.517989Z

No, takes ~200ms. The load file takes more than a second

onetom 2025-10-06T18:28:26.491369Z

what action do u refer to, when u say "load file"? the one bound to Cmd-Shift-L on macOS?

Santiago Cabrera 2025-10-06T18:30:46.293699Z

Yes, precisely

onetom 2025-10-06T06:21:35.127679Z

When I navigate to a namespace with the Plugins / Cursive / Namespace... action, the Project tool window opens up automatically, so I keep have to close it down with Cmd-1. How do I disable this behaviour? Is this some IntelliJ setting?

onetom 2025-10-06T06:24:46.077939Z

actually, it seems to only happen, when i confirm the selected namespace with Shift-Enter, to open it in a split.