Fork me on GitHub
#cider
<
2021-09-29
>
yefoakira10:09:54

Hi, I seem to be having an issue running tests on cider. I have setup a :once use-fixtures. When running directly lein test, the test that needs the fixture passes, but when running cider-tests it doesn't. Adding a println line within the fixture I can see cider actually printing it, so not 100% sure what is going on, and the documentation doesn't make any reference.

vemv10:09:02

in what way does the test fail?

vemv10:09:04

a somewhat usual suspect is that under the Lein runner, *ns* is always user . In an interactive CIDER session it can easily change

yefoakira10:09:23

The fixture setups dynamodb-local. So it fails because it thinks dynamodb-local hasn't been setup (actually because the table cannot be found). The fixture and the test are on the same namespace. The table and the dynamo local are being taken care of in the fixture after the (f) call.

vemv10:09:50

You can always try (clojure.test/run-tests) from the CIDER repl. That might narrow down things Otherwise place assert s strategically for ensuring whatever assumptions you have about the test setup hold true

yefoakira11:09:34

(clojure.test/run-tests) works when switching into the namespace (which is why I was expecting). Will need to investigate a bit more about the behaviour of cider.

vemv11:09:53

feel free to share the test failure itself over here

yefoakira11:09:27

The specific error returned is {:type com.amazonaws.dynamodb.v20120810#ResourceNotFoundException, , :Message Cannot do operations on a non-existent table ... (i am using cognitec.aws) The setup of the fixture is like

(setup dynamo-process)
(reset! client (aws/client ...))
(aws/invoke @client ... :CreateTable ...)
(f)
(aws/invoke @client ... :DeleteTable)
(reset! client nil)
(stop dynamo-process)
Somehow I am thinking that the (f) is executed out of order ... or is it possible that the fixture gets called, but the test is not run inside the http://fixture.ee

vemv11:09:22

are you sure aws/invoke is a sync/blocking operation? Maybe CIDER is running things too fast? either way println and assert are your friends, this way you can get an idea of what is going on (in what order)

yefoakira12:09:38

Ah, awesome, so the issue is that the client, for some reason, can't access the process (it is done through an http endpoint). The order of calls was fine. The server created using (.exec (Runtime/getRuntime ...) is not accessible on Cider. Ok, now that smells like I am not doing something I need to do

yefoakira12:09:48

There is an async version of invoke, but is on a different namespace. I will keep looking at it.

Toni Tuominen11:09:32

I have a problem connecting to a clojurescript repl. If I run cider-connect-cljs from a clojure project I get the following error: helm-M-x-execute-command: Symbol’s function definition is void: parseclj-alist. It works fine if I run it from non clojure project file. Any ideas?

1
Toni Tuominen08:09:26

Turns out it was a bug in cider/parseclj. I updated to parseclj 1.0.4 and it fixed the problem.

diego.videco15:09:16

Hello, got a problem but I am not sure whether it's due to emacs, prelude or cider. The problem is that every now and then something happens that starts activating something in the minibuffer that starts asking for a Lisp Expression, which I can apparently cancel with C-g or just by typing something into it. But after that happens the first time it continues to happen whenever I type a few characters. I have no idea how I am activating it, but it happens often and the only solution I have found is to restart emacs. Any ideas why this happens and how can I deactivate it once it gets started?

winsome15:09:53

I see this occasionally, you can deactivate it by turning off company-mode

winsome15:09:10

I don't know a good actual fix, though

Carsten Behring20:09:53

I have that quite often lately.... Did not find an other way the quitting cider or even restart emacs. Any workaround is welcome.

Carsten Behring20:09:23

I use doom, so even an other Emax distribution

yuhan04:09:43

@U7AMPCPU2 try M-x toggle-debug-on-error and it should give a stack trace the next time you C-g out of the prompt

diego.videco13:09:31

thanks @UCPS050BV I'll try that

Carsten Behring07:10:31

@U7AMPCPU2 Did you find anything ? I have this issue very often , and it is very annoying. It seems to be related to "company mode". Or at least "from time to time " 2 things happen to me, company mode gets crazy (popup is loosing focus, completions via 'tab' does not do anything anymore) After some random pressing of "C-g" and "C-c C-c" then I get the "Lisp expression" issue. For me only emacs restart solves it so far

diego.videco15:10:07

hmm, not really, but disabling company-mode has been the best so far