2017-01-05 26 views
1

我想使用CIDER的cider-auto-test-mode在Emacs/CIDER中運行我的命名空間測試。每當我加載命名空間,但是,我得到錯誤Not an nREPL dict。有關如何解決這個問題或進一步調試的建議?「不是一個nREPL字典」使用蘋果酒自動測試模式

在描述我到目前爲止發現的內容之前:我使用CIDER 0.12.0,cider-nrepl版本0.10.0和nREPL 0.2.12。我知道CIDER/cider-nrepl版本差異不大;它不是由選擇,但如果它是這個問題的原因,我可以修復它。

在CIDER Github issuea follow-up humane-test-output issue上討論了相同的錯誤消息。我沒有發現我使用的構建過程中可能涉及humane-test-output的任何內容。

我第一次加載該文件(CC CK),測試運行,我得到了下面的堆棧跟蹤:

error("Not an nREPL dict") 
nrepl-dict-map(#[...] ((dict "context" "my `testing` comment" ...))) 
nrepl-dict-map(#[...] (dict "my-deftest-name" ((dict "context" "my `testing` comment" ...)))) 
cider-test-highlight-problems((dict "my-deftest-name" ((dict "context" "my `testing` comment" ...)))) 
nrepl--dispatch-response(...) 

當我toggle-debug-on-error在已經加載的文件後,測試沒有再次運行我得到這個堆棧跟蹤:

error("Not an nREPL dict") 
nrepl-dict-keys(((dict "context" "my `testing` comment" ...))) 
nrepl-dict-map(#[...] (dict "my-deftest-name" ((dict "context" "my `testing` comment" ...)) 
cider-test-clear-highlights() 
cider-test-execute(...) 
cider-test-run-ns-tests(...) 
cider--test-silently() 

稍有不同的堆棧跟蹤,但同樣的問題:dict名單is not a valid nREPL dict列表。雖然cider-test-highlight-problems明確期待並在dict列表中獲得a namespace and vars列表,但不會收到dict列表dict列表as apparently expected,而是會收到列表中列出的dict列表,如我的堆棧跟蹤中所示。

有關我如何進一步研究或解決此問題的任何建議?

+0

有什麼我可以幫助與「不是選擇」版本不匹配?聽起來這是一個不同的,但相關的問題? –

回答

1

首先要檢查的是CIDER與cider-nrepl版本的區別。

過去的情況是,你必須將cider-nrepl放入你的〜/ .lein/profile.clj的依賴部分,並且調整版本,直到錯誤消失。

您不再需要這樣做,並且會導致很多類似症狀的問題。這些天蘋果酒提供它自己的依賴當你運行cider-jack-in所以最常見的解決方案是從你的lein配置文件刪除蘋果酒,並讓它自動選擇正確的蘋果酒nrepl版本。

這可能不是問題,儘管對於至少任何出現問題的人來說,這是一件好事,而且以後會發現類似的症狀。