Fork me on GitHub
#cider
<
2018-01-18
>
gonewest81800:01:06

@bozhidar: do you expect the tests for cider-nrepl to work when invoked in cider itself? In particular, I’m getting failures in cider.nrepl.middleware.debug-integration-test if I visit the file and C-c C-k followed by C-c C-t C-n. The failing cases all sit inside step-in-to-function-in-current-project-test.

gonewest81800:01:10

The failures look very similar (might be identical?) to the test failures when run with cloverage. Tests in that namespace do not fail when run like lein with-profile +1.8,+test-clj test

dpsutton00:01:05

also to be aware of. the tests don't run correctly independently of each other

gonewest81800:01:11

@dpsutton, thanks, I’ll keep that in mind but it doesn’t seem to be the same issue.

gonewest81801:01:50

Running just the one namespace’s tests fails like so…

$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-debug in this context, compiling:(cider/nrepl/middleware/debug_integration_test.clj:29:3)
but if I edit (:require [cider.nrepl :refer [wrap-debug]]) in that namespace, then
$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test

lein test cider.nrepl.middleware.debug-integration-test

Ran 11 tests containing 181 assertions.
0 failures, 0 errors.

dpsutton01:01:31

sounds good. hadn't looked through it, just saw it was problems with testing

gonewest81801:01:43

Actually, the problem might be a classpath thing. I could probably use a hint on this… This test step-in-to-function-in-current-project-test describes its purpose as

;; We want to ensure that the debugger can find and instrument the code of a
  ;; function that lives in a regular file on the classpath (as opposed to,
  ;; for example, in a jar, which is tested later).

gonewest81801:01:14

And the first case to fail is

(--> :eval "(ns user.test.step-in
                (:require [cider.nrepl.middleware.debug-integration-test.fn :as test-fn]))")
  (<-- {:ns "user.test.step-in"})

gonewest81801:01:27

The ns fails because Message: {:ex "class java.io.FileNotFoundException", :id 486, :root-ex "class java.io.FileNotFoundException", :session "2e4b5c11-8c2c-4f98-b5f5-3c568568b077", :status ["eval-error"]}

gonewest81801:01:03

Which I am interpreting as (maybe?) a failure to find cider/nrepl/middleware/debug_integraton_test/fn.clj

gonewest81801:01:28

There’s a comment in the code that says literally “you cannot use the cider debugger to debug these tests :(” because the debugger has mutable global state that makes it impossible to isolate the debugging session’ from the tests.

gonewest81802:01:35

Nevermind. I wasn’t specifying the right profiles for cider-jack-in.

bozhidar07:01:13

A problem that solves itself I guess. 🙂

bozhidar07:01:00

And way too many Lein profiles - I don’t even remember at this point why the default lein profile for cider-nrepl isn’t including anything. As I told you - there’s a ton of potential for cleanup and improvement there.

wopeers09:01:35

Hi, I'm working on a project which uses http-kit. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?

qqq10:01:07

how do I tell cider-doc to ignore cider-prompt-for-symbol and just always use the symbol under point ?

qqq10:01:21

I want two separate hydra bindings, one for under symbol, one for prompting

qqq11:01:34

(cider-doc-lookup (cider-symbol-at-point))

qqq11:01:49

this function is amazing, saves all the chrome -> google -> clojuredocs "func name" searches

bozhidar11:01:37

> how do I tell cider-doc to ignore cider-prompt-for-symbol and just always use the symbol under point ?

bozhidar11:01:19

There’s a defcustom called cider-prompt-for-symbol - just set it to nil.

bozhidar11:01:56

Just keep in mind that’s going to affect all commands, not just cider-doc. Generally people want to same behavior across all similar commands.

bozhidar11:01:08

> Hi, I’m working on a project which uses http-kit. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?

bozhidar11:01:41

@wopeers I think that was some known, but inconsistent bug. If you can reproduce it reliably feel free to file a ticket.

bozhidar11:01:03

Perhaps de-instrumenting the function and instrumenting it again will work as some workaround.

bozhidar11:01:30

> I want two separate hydra bindings, one for under symbol, one for prompting

bozhidar11:01:37

You can just define some wrapper function like this:

(defun my-cider-doc ()
         (let ((cider-prompt-for-symbol nil))
             (cider-doc...

bozhidar11:01:21

Just a vague sketch using dynamic bindings to change the behaviour of the function you wrap - might be odd for Clojure devs, but it’s very common in Emacs Lisp.

qqq12:01:52

@bozhidar: (cider-doc-lookup (cider-symbol-at-point))`` works fine for my needs

bozhidar12:01:25

Fair enough. 🙂

qqq12:01:05

@bozhidar: this may take a while, I'm new to the 'elisp debugger'

bozhidar22:01:12

Btw, while debugging this I noticed that we weren’t highlighting test assertions that were defined interactively and failed, so at least I fixed this. 😄

qqq22:01:18

evil keys is screwing up my ability to use edebug

qqq22:01:46

this is going to take longer than expected, I ca nset the brea point and on executing cider-test-run-test, have it load up cider-test.el at the (let ((ns ...

qqq22:01:52

but can't get it to step through lines yet