magnars / kaocha-runner.el

An emacs package for running Kaocha tests via CIDER.
34 stars 4 forks source link

*kaocha-error* always empty #2

Open manuel-uberti opened 5 years ago

manuel-uberti commented 5 years ago

Hi,

first of all thanks for this package. I use kaocha regularly and this is a very welcome addition!

I am having some problems using it. Whenever I run the command kaocha-runner-run-tests I always get an empy *kaocha-error* window and the message Kaocha run failed. See error window for details.

I added kaocha to my deps in the deps.edn file, instead of having an alias for it, and I am using latest CIDER and clojure-mode from MELPA.

If it may be of any help, the project I am trying all this is here on GitHub: https://github.com/manuel-uberti/boodle

manuel-uberti commented 5 years ago

If I run cider-load-all-project-ns before using kaocha-runner everything works fine. Feel free to close this then, and sorry about the noise. :)

magnars commented 5 years ago

Hi Manuel! I’m glad you find the package useful. :) Instead of closing this straight away, maybe you could add a section to the readme about the symptoms and solution for this issue? I’m sure you’re not the last to see it.

lør. 17. aug. 2019 kl. 09:54 skrev Manuel Uberti notifications@github.com:

If I run cider-load-all-project-ns before using kaocha-runner everything works fine. Feel free to close this then, and sorry about the noise. :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/magnars/kaocha-runner.el/issues/2?email_source=notifications&email_token=AACA4OMA2JNQZBK5IDDRDJTQE6VDNA5CNFSM4IMOUMH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QF2WI#issuecomment-522214745, or mute the thread https://github.com/notifications/unsubscribe-auth/AACA4OINYUNGT2L6HNB6WA3QE6VDNANCNFSM4IMOUMHQ .

magnars commented 5 years ago

Or maybe better: can we detect this issue somehow and display a helpful message in the error buffer?

lør. 17. aug. 2019 kl. 10:40 skrev Magnar Sveen magnar@kodemaker.no:

Hi Manuel! I’m glad you find the package useful. :) Instead of closing this straight away, maybe you could add a section to the readme about the symptoms and solution for this issue? I’m sure you’re not the last to see it.

lør. 17. aug. 2019 kl. 09:54 skrev Manuel Uberti <notifications@github.com

:

If I run cider-load-all-project-ns before using kaocha-runner everything works fine. Feel free to close this then, and sorry about the noise. :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/magnars/kaocha-runner.el/issues/2?email_source=notifications&email_token=AACA4OMA2JNQZBK5IDDRDJTQE6VDNA5CNFSM4IMOUMH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QF2WI#issuecomment-522214745, or mute the thread https://github.com/notifications/unsubscribe-auth/AACA4OINYUNGT2L6HNB6WA3QE6VDNANCNFSM4IMOUMHQ .

manuel-uberti commented 5 years ago

I'm not sure if this is related to kaocha-runner or to cider still in the middle of loading something, to be honest. Probably makes sense hear what @bbatsov thinks about this too.

bbatsov commented 5 years ago

Well, it depends on whether this commands runs only loaded tests or not. I assume it relies on the ns-es being loaded and CIDER doesn't load anything automatically as this might trigger some side effects.

manuel-uberti commented 5 years ago

I see, thanks for the clarification.

Should we point this out in the README in case anyone else encounters this problem?

bbatsov commented 5 years ago

Probably. That's a general thing about REPL-based tooling, though - everything there operates only on loaded code. It's the same with CIDER's own test runner - it won't run anything if there aren't any tests evaluated already.

manuel-uberti commented 5 years ago

Great. If @magnars thinks it's OK, I can add a note to the README point to this explanation, just to make it clearer why it could be necessary to run cider-load-all-project-ns before using kaocha-runner.

bbatsov commented 5 years ago

Well, I guess the explanation should be more like "you need to have to some test namespaces loaded" for the runner to do something and you can suggest using the command to load the entire project with a disclaimer.

bbatsov commented 5 years ago

I've noticed a similar note in the README already - "Note that kaocha-runner does not evaluate your code in any way. You'll have to evaluate the code first, with a (reset) or just C-c C-k in the buffer.". I think it can just be extended and some emphasis can be put on it.

magnars commented 5 years ago

I tried running Kaocha without loading any tests, and simply got "0 assertions, 0 tests", so there is something else going on here as well. Adding some more docs to the README makes sense, but I would also like if we could reproduce the blank error and make it not blank.