kaocha

imre 2024-01-23T11:23:07.912929Z

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

cjohansen 2024-01-23T11:58:15.757779Z

{: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

cjohansen 2024-01-23T11:58:21.649309Z

Works for me

imre 2024-01-23T12:14:57.623729Z

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

cjohansen 2024-01-23T12:15:55.562999Z

Ah, sorry, I misread 🙈

imre 2024-01-23T13:00:00.030749Z

nb, appreciate the intent!

2024-01-23T14:10:48.516199Z

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

imre 2024-01-23T14:57:48.976419Z

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)

imre 2024-01-23T14:58:18.560709Z

And so I'm looking around for examples

2024-01-23T14:59:59.389009Z

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

2024-01-23T15:00:56.186499Z

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

imre 2024-01-23T15:01:47.680929Z

yeah probably

imre 2024-01-23T15:02:07.221249Z

perhaps build.clj is more focused on artifact creation ?

imre 2024-01-23T15:02:34.771789Z

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

👍 1
2024-01-23T15:03:33.802699Z

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

imre 2024-01-23T15:03:55.706769Z

I started using bb tasks for that actually

imre 2024-01-23T15:05:15.425349Z

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

2024-02-10T15:13:59.821349Z

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

2024-02-10T15:15:03.989899Z

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