This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-09
Channels
- # announcements (3)
- # babashka (120)
- # beginners (87)
- # calva (7)
- # clj-kondo (35)
- # cljsrn (25)
- # clojure (94)
- # clojure-austin (4)
- # clojure-europe (53)
- # clojure-nl (2)
- # clojure-norway (6)
- # clojurescript (16)
- # conjure (8)
- # cursive (6)
- # data-oriented-programming (2)
- # data-science (19)
- # datahike (1)
- # datalevin (29)
- # datomic (13)
- # fulcro (50)
- # gratitude (1)
- # honeysql (9)
- # jackdaw (2)
- # kaocha (7)
- # leiningen (3)
- # malli (4)
- # off-topic (4)
- # polylith (3)
- # re-frame (5)
- # reagent (1)
- # releases (1)
- # reveal (4)
- # shadow-cljs (17)
- # tools-deps (10)
- # vim (17)
- # vscode (4)
- # xtdb (3)
There is a current discussion in the #beginners channel about better test output. Particularly this comment showed me the emacs/cider folks have it a lot better imo: https://clojurians.slack.com/archives/C053AK3F9/p1660053669990529?thread_ts=1660052001.155669&cid=C053AK3F9 But in my global deps.edn I am calling in cider-nrepl and it's associated middleware. But I get the ole humdrum default test output, even when using the terminal repl, so I'm not sure what emacs is doing different considering we are using the same cider nrepl and middleware.
I'm curious what you folks use to run tests. I'm currently using the cognitect-labs test runner but now I'm thinking I should switch to something else.
We use the Cognitect one at work because it's minimal and straightforward. Kaocha is really nice and feature rich, definitely something I'd like to play with at some point. But it was a hard sell on my team, who has a strong preference for simple tools 🙂
I mean, if I were writing those unit tests more often, I would run them on my machine, and at that point, maybe I could look into using Conjure to run them. But at the moment, I'm more focused on writing integration tests, and we have our own whole custom framework and test runner for those
I mostly prefer kaocha in watch mode. But will occasionally use conjure too. I do want to improve the in editor experience but as I talked about in the #conjure thread, it's a little tricky to support while supporting non cider repls.
I run tests in a variety of ways, some with the lein test runner, some with kaocha. Sometimes I run them inside of vim with conjure and kaocha. Here's my output from the above mentioned test:
hmmm. that seems a bit more unclear to me tbh. I will look at kaocha
though just for when I want to use that watch
functionality
when running at the cli, kaocha adds color, which helps with readability and spotting the diffs
Yeah, I'm curious what having the middleware in my global deps.edn
actually gives me?
:repl {:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}
cider/cider-nrepl {:mvn/version "0.28.5"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--interactive"]}}}
because even when just running it in the terminal, I'm not seeing that same functionality.Often when running tests, I'm only working on a small change at a time so all I need is pass/fail indication. If I need more details than that I use Portal https://github.com/djblue/portal/blob/master/doc/guides/test-runner.md
Also, I think that Portal guide is a nice example of not relying on your editor's tooling. You can easily customise the running of tests to suit you.
Yeah, I've definitely had portal and it's alternatives on my to try list too. I was thinking more for debugging than testing. Thanks for the discussions folks. Most likely I'm just going to keep to cognitect's test runner and keep it simple too. I just would have preferred it to stay as simple but also give better output as shown that the emacs folks are getting using the same testing tool.
I also have used humane test output with some success. https://github.com/pjstadig/humane-test-output
I moved to Conjure from CIDER and I now have to resort to humane-test-output
to at least find the tests faster.
CIDER has a real test result buffer where you don't need that but more basic IDE plugins don't have that and rely on log output.