kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
miikka 2020-05-25T05:26:16.265100Z

Funnel looks nice

defa 2020-05-25T06:19:53.269300Z

How to run kaocha when there is a main-namespace defined in one of the aliases? My kaocha.sh script looks like this

#!/usr/bin/env bash
clojure -A:shared:server -m kaocha.runner "$@"
and in deps.edn there is a :main-opts ["-m" "server"] defined for the server alias. Now when running the script, the server gets started instead of kaocha. So the -m option to clojure is obviously ignored. Is there a ways without introducing an additional alias in deps.edn?

plexus 2020-05-25T07:53:58.270600Z

I think you can use -C:shared:server instead of -A:, have a look at clojure --help. You can control which part of the aliases gets used (extra-paths, mains, deps). -C will only handle the classpath, -A does everything

defa 2020-05-25T12:35:08.271600Z

@plexus Thanks, must have overlooked this option, but it seems not to be that easy:

java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'<http://clojure.java.io/Coercions|clojure.java.io/Coercions> found for class: clojure.lang.PersistentVector
 at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:583)
    <http://clojure.java.io|clojure.java.io>$fn__11366$G__11348__11371.invoke (io.clj:35)
… will look into that later, not sure what causes this error.

plexus 2020-05-25T12:39:11.272100Z

hmmm you have a vector somewhere where something is expecting it to be a filename or something similar

defa 2020-05-25T12:55:00.273500Z

Right, there was a typo in my tests.edn … and using a combination of -C and -A did the trick, thanks:

#!/usr/bin/env bash
clojure -A:shared -C:server -m kaocha.runner "$@"

defa 2020-05-25T12:56:30.273900Z

Thanks, @plexus.