Fork me on GitHub
#kaocha
<
2024-01-23
>
imre11:01:07

Hey folks. Has anyone come up with a nice way to integrate kaocha into a tools.build-based workflow?

cjohansen11:01:15

{:paths ["src"]
 :deps {org.clojure/clojure {:mvn/version "1.11.1"}}
 :aliases
 {:dev {:extra-paths ["dev" "test" "dev-resources"]
        :extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"}}}
  :test {:exec-fn kaocha.runner/exec-fn
         :exec-args {}}}}
Now you can evaluate tests in the REPL, and run clojure -Xtest

cjohansen11:01:21

Works for me

imre12:01:57

Thank you. What I really meant was a https://clojure.org/guides/tools_build integration

cjohansen12:01:55

Ah, sorry, I misread 🙈

imre13:01:00

nb, appreciate the intent!

Noah Bogart14:01:48

what would that integration look like? what are you hoping to accomplish?

imre14:01:48

I'm not entirely sure to be honest. With tools like tools.build, kaocha and babashka available, I'm trying to put together tooling around a project that makes it convenient to run and reproduce parts of a build/release pipeline both on a dev machine and in ci (gh actions/jenkins)

imre14:01:18

And so I'm looking around for examples

Noah Bogart14:01:59

well, if you're merely looking to use something like clojure -T:build test, then you could rely on kaocha.repl and pass in any args

Noah Bogart15:01:56

in my limited experience, there's not much difference between using a function in build.clj and just another alias in deps.edn: clojure -M:test:kaocha

imre15:01:47

yeah probably

imre15:01:07

perhaps build.clj is more focused on artifact creation ?

imre15:01:34

kaocha.repl has its drawbacks, one is that it doesn't support all plugins (cloverage for example)

👍 1
Noah Bogart15:01:33

At my job, we have a bin/ folder and fill it with bash scripts, so you just type bin/test or bin/build, and it calls the longer command

imre15:01:55

I started using bb tasks for that actually

imre15:01:15

and now trying to figure out how to 'front-end' all the commands - should CI invoke bb commands, should it invoke tools.build multiple times, or should is start a tools.build process that itself defines the stages of a pipeline etc

andrea.crotti15:02:59

I use babaska tasks to have a one true way to run all the useful commands

andrea.crotti15:02:03

I think CI can just invite BB tasks, don't see a problem with that