Fork me on GitHub
#kaocha
<
2021-09-13
>
plexus06:09:34

thanks for the heads-up!

Marc O'Morain08:09:11

@plexus I started looking into integrating Kaocha and Calva last night and I found that it “just worked”

Marc O'Morain08:09:59

Do you know how Kaocha runs when Calva initiates a cider-nrepl test command?

Marc O'Morain08:09:42

Does koacha hook into clojure.test?

plexus09:09:42

it probably doesn't run at all?

plexus09:09:06

Calva probably uses clojure-test directly

Marc O'Morain10:09:53

Hrm, I must have been mistaken last night. I’m getting now getting the behaviour that you (and I expect) - when I run Calva’s commands to test the current namespace, it issues test commands to the cider-nrepl test middleware, which runs tests using the clojure.test runner. I’d like to somehope wire this up so that I can run Kaocha commands from Calva. We use Kaocha for most projects in CircleCI, and a lot of developers use Calva.

Marc O'Morain10:09:51

I’ve found the nrepl-kaocha middleware: https://github.com/liquidz/kaocha-nrepl But unfortunately Calva doesn’t expose an extension point to allow folks to send custom nrepl commands.

Marc O'Morain10:09:04

One way to do this might be have Calva expose an API that exposes allows users to issue nrepl commands, and build a new extension that relies on Calva, that adds Kaocha commands.

plexus13:09:37

it's a missed opportunity that kaocha-nrepl uses custom nREPL ops, I think the better way would be to adhere to the contract of cider.middleware.nrepl/handle-test, so you can swap out the middleware (or have it occur earlier in the stack)

cap10morgan19:09:42

Does kaocha support the newer :exec-fn tools-deps feature? I think all it needs is an entrypoint fn that can take a map arg. it looked like kaocha.runner/run might work, but wasn't sure if it skipped some important init / sanity check code. anyone try that yet?

cap10morgan19:09:01

on closer inspection kaocha.runner/run looks a little too low-level for that. ideally I think we'd want a new / slightly refactored equivalent of kaocha.runner/main*

cap10morgan21:09:41

Anyway, just submitted a PR that adds -X support in the easiest way I could see to do it. Let me know if it should be more simple and less easy, as Rich might put it. 🙂

🙌 4