Fork me on GitHub
#cider
<
2020-10-29
>
Eamonn Sullivan10:10:28

Hi all, I think I've asked this question before, but I can't remember how I fixed it. I have a https://github.com/eamonnsullivan/github-api-lib that loads fine in Cider and I can run tests for namespaces (C-c , n), but when I try to run all of the project's tests, I get No assertions (or no tests) were run.Did you forget to use 'is' in your tests?. They run fine from the CLI (`clojure -M:test:runner`). What is cider looking for and isn't finding?

practicalli_john11:10:43

@eamonn.sullivan the cider test runner will run tests evaluated in the repl. Test runners (:test/runner) will run the tests by reading all the source code files. When using the cider test runner I typically evaluate the test code in the REPL first. In Spacemacs a wrapper was added to evaluate the current namespace before calling cider test runner, so running cider-test-run-all-tests command from the *_test.clj file usually loaded all the tests.

Eamonn Sullivan11:10:05

I do the same, but even if I evaluate all of the tests and code (C-c C-k) on every file, cider still doesn't run the project tests. It's not a huge deal. I just like that happy little feeling to see all of the assertions passing, but the important ones are about the code I'm currently modifying...

Eamonn Sullivan11:10:30

C-c , l (run loaded tests) also fails with the same error, even when all of the tests are loaded. I'm pretty sure there was some way to set up the aliases to get this to work...

practicalli_john13:10:07

I assume the alias used which cider-jack-in or when starting the repl externally, includes :extra-paths ["test"] I include the following alias in my ~/.clojure/deps.edn

:env/dev
  {:extra-paths ["dev"]} 
https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L80-L82

otfrom12:10:33

hmm... I seem to be having a problem with emacs taking ~100% cpu and hanging while trying to debug some code. Is anyone else having a similar issue? (it might just be b/c the function is horrible, but if it wasn't so ugly I wouldn't need the debugger 😄 )

otfrom12:10:48

I'm getting a Syn nREPL request timed out and my emacs locks up nicely. I'm running the latest from MELPA on emacs 27.1

otfrom12:10:10

(I'm presuming it is me which is why I'm asking first)

practicalli_john12:10:49

@otfrom I assume you are using o from the debug menu if you need to step over any infinite lazy sequences, eg. (range). Thats the only time I recall blowing up emacs with cider debug.

otfrom13:10:29

debugging a much shorter function seems to work. I'll need to remember to step over the lazy seqs (esp the infinite ones)

practicalli_john13:10:49

I learnt by forgetting to do this many times 🙂

otfrom13:10:59

one thing (that I'm pretty sure is a config thing) is that when I am debugging, I get the truncated value in the src window where I'm stepping through, but I get a much larger single line value that goes to *Messages*, which then slows down all of emacs due to the long lines bug. Is there a way to turn this off?

otfrom13:10:05

I know I can delete the buffer (same as I know how to clear the repl buffer), but I'd like to stop it from happening

otfrom13:10:27

I'm having a look at that now. I'm wondering if it is the minibuffer bit of the overlay

otfrom14:10:15

hmm... I can't find a way to get at this. I've limited the overlay to only show at the end of the line, not the mini-buffer, I've changed the print quota to 160. Had a look through the docs and the issues and I can't find a way to limit printing of large data structures (not infinite, but big) in *Messages*

otfrom14:10:16

not quite sure what to do next

otfrom16:10:19

I'm solving the debugging problem by just rewriting the horrible code

👍 2
waffletower20:10:22

cider and cljfmt seem to be in accord. I now work for a company that uses cljstyle, and sadly cider/cljfmt and cljstyle have indentation differences. Besides using a after-save-hook has anyone reconciled these unfortunate differences in a way they could live with?

dpsutton20:10:52

clojure-mode has a few different settings for indentation. ideally you can get clojure-mode to indent in the way you like and then put them in a dir locals file for your work repo

waffletower20:10:53

Thanks, will probably have to create a lot of dir locals files 😀

dpsutton20:10:58

you should only (or hopefully) need only a single one. put it at the root of your directory structure and it will cascade to any file in that tree

👍 2