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
(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?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.
With C-c C-k
it does work.
If you run all project tests it doesn indeed say no tests found
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
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)
: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.
hmm I might have found out why, but not sure yet
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)
It might be something related to this: https://docs.cider.mx/cider/1.0/testing/running_tests.html#test-namespace-naming-convention
thanks, it didn't work at first but then I restarted CIDER and it started working
It's not really a solution because I don't know why it works after reordering 😅
This is the code that actually runs the tests https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/test.clj#L315
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.
But as usual - you have to evaluate the test definitions before you're able to run any tests.
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
If someone wants to help with this - be my guest.
I did evaluate them before trying to run them, but it still reported there being no tests.
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.
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?
Most likely you're using an old version of cider-nrepl
.
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.
Ah, THANK YOU! 🙏
Was about to loose my mind there 😅 Upgraded things, and now it's back to awesome. Thanks for your hard work!
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.
found the slowdown in cider-test-clear-highlights
and cider-test-highlight-problems
commenting those out makes everything perform instantly again
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
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.
awesome! glad the issue has gone away
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
i actually installed doom-emacs to see if it was my emacs config
how did you have an old version of cider-nrepl around?
project is old, everything was working didn't think to update that