Fork me on GitHub
#cider
<
2021-01-14
>
zackteo05:01:46

Does anyone know what might be causing me to get a popup of Lisp expression: in the minibuffer whenever I type something like ;; t? Been trying to isolate the problem, and it seems that it only happens after I start a cider session

Sergej Koščejev08:01:19

(I asked this in #beginners but this channel might be better.) I have a deps.edn project with a single file looking like this:

(ns stuff)

(ns stuff-test (:require stuff) (:use clojure.test))

(with-test
  (defn sum [s]
    (+ s 2))
  (is (= 2 (sum 1))))
and I'm asking CIDER to run all tests in project. But it's telling me that there are no tests. What am I doing wrong?

Eamonn Sullivan08:01:20

Did you evaluate the tests? On my keymap, that's C-c, C-k, but I think it's cider-eval-buffer or something like that.

solf09:01:00

With C-c C-k it does work. If you run all project tests it doesn indeed say no tests found

solf09:01:54

My intuition is that there might be some hardcoded logic linked to run tests in project that tries to find namespaces in a test directory

Sergej Koščejev09:01:40

C-c C-k is cider-load-buffer in my keymap, it just loads the thing but doesn't run any tests (the test should fail)

Eamonn Sullivan09:01:46

:man-shrugging: Yeah, I haven't been able to get cider to run all the project's tests, but I use deps.edn on all of mine and I thought that would be why. I just have cider run the tests for the file I'm working on (which does work, after being eval'd) and run all tests in a terminal window.

solf09:01:43

hmm I might have found out why, but not sure yet

solf09:01:57

it works if you re-order the file as follows:

(ns stuff-test (:require stuff) (:use clojure.test))
(with-test
  (defn sum [s]
    (+ s 2))
  (is (= 2 (sum 1))))

(ns stuff)

Sergej Koščejev09:01:28

thanks, it didn't work at first but then I restarted CIDER and it started working

solf09:01:16

It's not really a solution because I don't know why it works after reordering 😅

bozhidar10:01:16

There's no logic related to folder in which the tests are placed. Tests have some special metadata attached to them, and this is what CIDER is looking for to evaluate them.

bozhidar10:01:30

But as usual - you have to evaluate the test definitions before you're able to run any tests.

Sergej Koščejev10:01:24

I did evaluate them before trying to run them, but it still reported there being no tests.

Eamonn Sullivan10:01:16

I vaguely remember being able to run all project tests in CIDER back when I used lein, but I've not successfully gotten this feature to work with tools.deps. I asked about this a while back and never got an answer. It's not a big deal (I typically just want to run the tests against the code I'm working on, and can run them all in a terminal), but it would be nice to have.

bozhidar10:01:12

Often people mention they are having problems with navigation to Java definitions. Seems we've finally found the root cause of the issue https://github.com/clojure-emacs/orchard/issues/103

bozhidar10:01:25

If someone wants to help with this - be my guest.

cjohansen13:01:04

When I evaluate an expression with cider-eval-last-sexp that results in an exception, the exception opens in a buffer asynchronously. This has started to take a very long time - upwards of several tens of seconds. When the buffer opens, I've usually long since fixed the underlying problem, but the buffer steals focus of the cursor. Is this a known problem, or could it be something else in my setup that's causing this?

bozhidar09:01:50

Most likely you're using an old version of cider-nrepl.

bozhidar09:01:13

A bunch of people reported experienced this issue after I should down http://clojuredocs-export.netlify.com. Frankly, I didn't expect that something like this would happen, otherwise I would have handled the situation differently.

cjohansen05:01:06

Ah, THANK YOU! 🙏

cjohansen05:01:35

Was about to loose my mind there 😅 Upgraded things, and now it's back to awesome. Thanks for your hard work!

naomarik14:01:10

can anyone point me to a starting point to investigate why running any of the cider-test commands is taking a long time to run tests and show a report? everything else is instant and running tests manually with test/run-tests is also instant. nothing else about my dev environment is lagging, and awhile back running tests via cider wasn't doing this.

naomarik20:01:11

found the slowdown in cider-test-clear-highlights and cider-test-highlight-problems commenting those out makes everything perform instantly again

naomarik20:01:55

digging deeper, cider-sync-request:info is taking 2 seconds. in nrepl-send-sync-request (nrepl-send-request) with: (op info ns user sym sah.core-test/zh) as the request parameter is taking 2.5 secs to get a response. i have no idea where to go from here

naomarik22:01:20

Ooops I lied, you see the reason why I'm a projrammer is not because I want to be, but because I can get myself out of being stuck. I updated cider-nrepl from 0.25.2 to 0.25.6 and it's perfect now.

dpsutton22:01:48

awesome! glad the issue has gone away

naomarik22:01:15

as a benefit my cider-error stacktrace window pops up instantly now instead of lagging for 5 seconds... actually disabled it because it was driving me crazy

naomarik22:01:35

i actually installed doom-emacs to see if it was my emacs config

dpsutton22:01:24

how did you have an old version of cider-nrepl around?

naomarik22:01:43

project is old, everything was working didn't think to update that