This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-12
Channels
- # adventofcode (49)
- # announcements (22)
- # beginners (33)
- # calva (5)
- # clj-kondo (6)
- # clojure (30)
- # clojure-europe (6)
- # clojure-japan (1)
- # clojure-nl (9)
- # core-logic (17)
- # data-oriented-programming (1)
- # datalevin (1)
- # datomic (2)
- # gratitude (2)
- # jobs (2)
- # kaocha (8)
- # lsp (1)
- # malli (8)
- # meander (8)
- # off-topic (18)
- # rdf (1)
- # re-frame (4)
- # reagent (16)
- # releases (1)
- # sci (1)
- # sql (1)
- # tools-deps (4)
- # xtdb (3)
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.clojure.exec doesnt start the watcher, but clojure.main does
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 usedEven 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.By the way, Arne fixed this issue and released it: https://github.com/lambdaisland/kaocha/pull/264#issuecomment-1003613653
Excellent, I will try this tomorrow. Thanks for the fix and letting me know.
You're welcome!