kaocha

practicalli-johnny 2021-12-12T12:23:51.022300Z

Kaocha watcher issue: I can run the Kaocha watcher for a new deps.edn project using the clojure.main approach, however, I cannot seem to trigger the watcher when using the clojure.exec approach I created a project using clj-new using the app template, which has one failing test by default. I did not add a test.edn config as I just wanted a minimal setup to run kaocha across any deps.edn project. (I could perhaps add a generic test.edn in the ~/.clojure/ directory and point to that) I created a user wide alias in ~/.clojure/deps.edn with both clojure.main and clojure.exec configuration. The clojure.exec with the :watch? true config does a test run, but then ends, so I assume the :watch? config (and it seems :randomise too) is being ignored somewhere This is the alias I am using

:test/kaocha-watch
  {:extra-paths ["test"]
   :extra-deps  {lambdaisland/kaocha {:mvn/version "1.60.945"}}
   :main-opts   ["-m" "kaocha.runner" "--watch"]
   :exec-fn kaocha.runner/exec-fn
   :exec-args {:watch? true
               :randomize? false
               :fail-fast? true}}
I get the same issue if I add clojure.exec arguments on the command line clojure -X:test/kaocha-watch "{:watch? true}" I'll add a screenshot as a thread.

Alys Brooks 2022-01-05T21:16:21.034400Z

You're welcome!

Alys Brooks 2022-01-04T16:50:07.031700Z

By the way, Arne fixed this issue and released it: https://github.com/lambdaisland/kaocha/pull/264#issuecomment-1003613653

practicalli-johnny 2022-01-05T02:34:45.033900Z

Excellent, I will try this tomorrow. Thanks for the fix and letting me know.

practicalli-johnny 2021-12-12T12:24:28.022400Z

clojure.exec doesnt start the watcher, but clojure.main does

practicalli-johnny 2021-12-12T12:27:47.022800Z

I added a second test to the Clojure project, this time a passing test and re-ran the clojure.exec approach with command line arguments

clojure -X:test/kaocha-watch "{:watch? true}"
This did one test run and then ended, so it seems none of the arguments are being used

practicalli-johnny 2021-12-12T12:27:53.023Z

practicalli-johnny 2021-12-12T13:19:23.023400Z

Even when I include a test.edn in the root of the Clojure project, using the clojure.exec method to run kaocha does not use the watch? true configuration In my tests.edn file

#kaocha/v1 {:watch? true
            :kaocha/fail-fast? true
            :kaocha.plugin.randomize/randomize? false}
If I call Kaocha with the clojure.main config, it does pick up the tests.edn configuration and run the watcher. So something in the path of the clojure.exec call the configuration is not being applied it seems.