cursive

Issues at: https://git.io/cursive-issues
cfleming 2020-11-10T00:45:26.197400Z

So with that, is the problem fixed? That’s possible, since IntelliJ doesn’t use the same CWD or PATH as lein itself.

cfleming 2020-11-10T00:46:02.197600Z

Sadly, right now, you can’t, although testing in general is something I’m working on at the moment.

Empperi 2020-11-10T13:37:44.201800Z

OK. I've spent this day debugging a problem where my integration tests just hang indefinitely. Now I've come to conclusion that it is actually a bug in Cursive and more specifically in the part of code that evaluates test assertion diffs. The reason why I've come to this conclusion is because if I execute tests from command line with lein test everything works fine. They also work fine in REPL if I use run-tests. This is true both for command line lein repl and within Cursive lein repl. However, if I use "Run tests in Current NS in REPL" keyboard shortcut (which I use all the time) they hang when a database query is done. To make matters more weird, this doesn't happen with all my tests, just this one causing issues. Also, if I remove assertions using is then they do not hang (but naturally tests are useless). Unfortunately I cannot share code which causes this issue. It is using HikariCP, next.jdbc and PostgreSQL database for this specific test. One additional thing is that my integration tests are wrapped with defintegrationtest macro which I can share:

(defmacro defintegrationtest
  "Defines an integration test. The main effect of this is a proper binding
   to 'lein test :integration'. Otherwise this is identical to normal deftest."
  [name & body]
  (when *load-tests*
    `(def ~(vary-meta
             (vary-meta name assoc :integration true)
             assoc :test `(fn [] ~@body))
       (fn [] (test-var (var ~name))))))

Empperi 2020-11-10T13:38:32.202200Z

If I change that to deftest the situation doesn't really change though

Empperi 2020-11-10T13:38:59.202600Z

However I am using test-ns-hook functionality within Clojure test

cfleming 2020-11-13T07:20:58.223600Z

Sorry for the slow reply on this - is the failing test the only one using test-ns-hook?

Empperi 2020-11-10T13:40:38.203Z

I wish I could give more information but this is a super weird bug and it is super annoying

2020-11-10T14:45:39.204200Z

Idk if this is a cursive bug, but if I start a REPL from within intellij/cursive and then start a Jetty webserver, the webserver persists after intellij is closed.

2020-11-10T14:46:12.204900Z

My expectation is that it'd die with the repl process that started it (nrepl)

Empperi 2020-11-10T19:20:36.207200Z

@solussd this is what you will get if you try to exit IntelliJ with active REPL session. If you choose "disconnect" then REPL process is left alive and so is your Jetty. If you choose "terminate" REPL process is also killed as is your Jetty. If you however have checked "don't ask me again" and have chosen "disconnect" then it will perform like you described. So no, not a bug in Cursive.

Empperi 2020-11-10T19:22:23.207800Z

I'm quite certain remembering the option can be reverted from somewhere

2020-11-10T19:26:00.208700Z

@niklas.collin thanks- that explains it. I had slightly different reasoning. I assumed, incorrectly, that the repl process was a sub-process of intellij, but that doesn't make sense now that I think about it.

Empperi 2020-11-10T19:26:27.208900Z

Well it actually is

Empperi 2020-11-10T19:26:36.209100Z

But it is tracked properly

2020-11-10T19:32:04.209400Z

@niklas.collin fixed:

👍 1
Empperi 2020-11-10T19:32:31.209900Z

Happy to help