This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (2)
- # babashka (31)
- # beginners (608)
- # cider (60)
- # clj-kondo (22)
- # cljsrn (28)
- # clojure (14)
- # clojure-europe (5)
- # clojure-nl (3)
- # clojure-spec (1)
- # clojure-uk (19)
- # clojurescript (38)
- # conjure (20)
- # cursive (9)
- # data-science (26)
- # datascript (4)
- # datomic (19)
- # duct (4)
- # emacs (8)
- # figwheel-main (5)
- # fulcro (7)
- # helix (15)
- # leiningen (12)
- # malli (2)
- # off-topic (20)
- # overtone (3)
- # pathom (14)
- # pedestal (10)
- # re-frame (2)
- # reitit (13)
- # ring (13)
- # shadow-cljs (18)
- # spacemacs (8)
I'm finding that I am getting different test results when running the suite from inside CIDER through
C-c C-t p than when I run them on the terminal through
lein test . Has anyone run into this before? I think I'm missing some context on how tests work within CIDER possibly. Is
C-c C-t p doing something wildly different than
you mentioned that your tests were profile dependent. is it possible that you are running with different profiles? If not, is it possible that you are not reevaluating the code you need so lein test sees your updated code but your repl doesn't have new definitions re-evaled?
That's right, I am providing
with-profile +my-profile to the cider-jack-in command that I am customizing through the
C-u M-x cider-jack-in RET method here https://docs.cider.mx/cider/0.24/basics/up_and_running.html#_customizing_the_jack_in_command_behaviour.
However, what is curious is that if I jack-in without the profile I will see the error I expect to see (and that I will get on ther terminal) if that profile is omitted. I'm seeing a new and diferent error in cider when I jack-in with the profile present.
and there's no test selectors involved? and doing this from a fresh cider-jack-in shows a different error?
yep, fresh nREPL - the terminal will run alltests successfully when that profile is provided. I'm wondering if the project itself is doing something profoundly strange that might be affecting the test runner (this is a project I am new to)
CIDER introduces a thing that throws if you accidentally do
(is (= 1)) saying equality should need multiple arguments
and i think there are some other libs that do that too. many humane-test-output or something similar
I am seeing some tests fail with an java.lang.IndexOutOfBoundsException error in weird looking situations, hm
you'll have to run with the
lein with-profile +sample test - the sample profile for reasons lost to time is required
lein test cloverage.kahn-test lein test cloverage.report-test lein test cloverage.report.console-test lein test cloverage.sample.dummy-sample lein test cloverage.sample.multibyte-sample lein test cloverage.sample.read-eval-sample lein test cloverage.source-test
cloverage.args-test cloverage.coverage-test cloverage.dependency-test cloverage.instrument-test cloverage.kahn-test cloverage.report-test cloverage.report.console-test cloverage.sample.exercise-instrumentation cloverage.source-test
so I just had tests succeed when being run from cider, but then fail on the next run; so clearly something very weird is happening here
notably what you mention, that it looks like there's a different set of namespaces being run
Hi people. It seems that clojurescript won’t jack in properly if there’s some namespace it an invalid ns (like
That’s because of https://github.com/clojure-emacs/cider/blob/master/cider-connection.el#L264,
(cider-util--clojure-buffers) ends up finding a file with this ns and it fails trying to get the ns name or something like that.
Is this considered a bug? If so, I can open an issue with the stacktrace or even try to fix it (by ignoring the error, perhaps? Or printing a friendlier error message instead of letting it fail later with
(you might wonder how I end up having this wrong ns declaration. The reason is that I created a clj file with
spacemacs/open-junk-file. As I used the
clj extension, it automatically added
(ns ) for me. This file was not part of any project, I only created it for pasting some clojure code that I intended to format. 🤷)
for sure open an issue. it seems strange to me that this would prevent jacking in. But this seemingly would prevent compiling and if you can't compile you usually can't load the output in a page so you don't connect your application. what is the repro here? figwheel/figwheel-main/-m cljs.main/shadow?
Oh, sorry, it did jack in, actually. It created a repl buffer in a pending state or something like that (I could tell this from the buffer name). But I was unable to evaluate stuff.
ok. the pending state means it hasn't connected to the application yet. and that's because there isn't a compilation output since its invalid code
when you tried to evaluate stuff i imagine you got an error like "no connected application" or something similar?
This is the stacktrace:
When I try to evaluate something, there’s no error. But nothing happens. When I try to use
Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 5 6) scan-sexps(5 1) forward-sexp(1) clojure-forward-logical-sexp() clojure--find-ns-in-direction(backward) clojure-find-ns() cider-current-ns() cider-refresh-dynamic-font-lock() cider-mode(1) cider-enable-on-existing-clojure-buffers() #f(compiled-function () #<bytecode 0x477bb459>)() #f(compiled-function (buffer) #<bytecode 0x4770c08d>)(#<buffer *cider-repl nu/timeline:localhost:63972(pending-cljs)*>) #f(compiled-function (response) #<bytecode 0x4770c109>)((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done"))) #f(compiled-function (response) #<bytecode 0x4770c151>)((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done"))) nrepl--dispatch-response((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done"))) nrepl-client-filter(#<process nrepl-connection> "d2:id1:47:session36:f0733cfc-31b2-4759-bb10-2416c787fa6f5:value3:niled2:id1:42:ns11:shadow.user7:session36:f0733cfc-31b2-4759-bb10-2416c787fa6fed2:id1:47:session36:f0733cfc-31b2-4759-bb10-2416c787fa6f6:statusl4:doneee")
cider-switch-to-repl-buffer, it says
user-error: No cljs REPLs in current session "<my-project-name>:localhost:64265"
> what did you do to trigger an error?
It is thown just after
cider-jack-in -> cljs ->
shadow -> <profile>
> and do you have unbalanced parens in a buffer?
The minimal file for reproducing it is
Perhaps it assumes there’s a second form in
Well, I’ll open the issue then, as it looks legit
Hummm, yeah, agreed. Perhaps
clojure-find-ns() should make it explicit that if there’s no ns, it would return
nil. It’s not clear what’s the expected behaviour just by looking at the current docstring.
Yeap Well, I just opened the issue here, since I’m not sure who should handle this: https://github.com/clojure-emacs/cider/issues/2849 Thanks for helping me, dpsutton