This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-05
Channels
- # announcements (8)
- # asami (70)
- # babashka (28)
- # beginners (163)
- # calva (7)
- # cider (15)
- # clj-kondo (47)
- # cljs-dev (45)
- # clojars (2)
- # clojure (56)
- # clojure-europe (24)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-spec (2)
- # clojure-uk (53)
- # clojurescript (46)
- # data-oriented-programming (15)
- # data-science (10)
- # datahike (2)
- # defnpodcast (1)
- # depstar (27)
- # emacs (35)
- # figwheel-main (28)
- # fulcro (38)
- # girouette (1)
- # graphql (16)
- # jobs-discuss (3)
- # kaocha (9)
- # keechma (2)
- # leiningen (6)
- # lsp (87)
- # malli (19)
- # membrane (16)
- # pathom (4)
- # re-frame (11)
- # shadow-cljs (25)
- # spacemacs (2)
- # testing (12)
- # tools-deps (14)
- # tree-sitter (4)
- # xtdb (20)
Hi, I just upgraded to the latest version. I used to setup my test runner like this
:runner {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.0.641"}}
:main-opts ["-m" "kaocha.runner"]}
this now gives my deprecation warnings
❯ clj -A:test:runner --focus unit
WARNING: When invoking clojure.main, use -M
but after reading the docs I am not sure how to address them@sofra Use clj -M:test:runner --focus unit
With the introduction of -X
for function execution, -M
has been expanded from just :main-opts
to include deps/paths as well and is how you should run anything relying on clojure.main
(`:main-opts`). -A
is going to be reserved for starting a REPL in due course (but still functions as before, except with that warning).
thanks @seancorfield for the explanation
I had tried with -M
instead of -A
but it seems to look for the kaocha.runner
as a file on the file system then
❯ clj -M:test:runner --focus unit
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
kaocha.runner (No such file or directory)
@sofra I just created a brand new project and put this in it:
:aliases
{:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}}}
:runner {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.0.641"}}
:main-opts ["-m" "kaocha.runner"]}
...}
and it works fine for me:
$ clojure -M:test:runner --focus unit
[(F)]
Randomized with --seed 150177492
FAIL in sofra.example-test/a-test (example_test.clj:7)
FIXME, I fail.
Expected:
0
Actual:
-0 +1
1 tests, 1 assertions, 1 failures.
I think perhaps you changed your :main-opts
?
That's with the latest prerelease:
$ clojure --version
Clojure CLI version 1.10.2.801
but I can try it with the latest stable version...(I just double-checked it works with 1.10.2.790 as well)