Deps.edn ignores :extra-paths for cognitect.test-runner

I have a strange problem with deps.edn. This is my config:

deps.edn:

{:paths ["src/main/clojure"]
 :deps {org.clojure/clojure {:mvn/version "1.11.1"}}
 :aliases
 {:test {:extra-paths ["src/test/clojure"]
         :extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
                      io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
         :main-opts ["-m" "cognitect.test-runner"]
         :exec-fn cognitect.test-runner.api/test}

  :kaocha {:main-opts ["-m" "kaocha.runner"]
           :extra-deps {lambdaisland/kaocha {:mvn/version "1.77.1236"}}}}}

tests.edn:

#kaocha/v1
 {:tests [{:id          :unit
           :test-paths  ["src/test/clojure"]
           :ns-patterns [".*"]}]}

And for some very strange reason this works:

clj -M:kaocha "$@"

[(.............................................)]
4 tests, 45 assertions, 0 failures.

And this doesn’t:

clj -M:test

Running tests in #{"test"}

Testing user

Ran 0 tests containing 0 assertions.
0 failures, 0 errors.

Can anybody please explain why does deps.edn ignore :extra-paths ["src/test/clojure"] ?

Thank you.

You need to specify the directory in which to search for tests, which defaults to "test".

--dir src/test/clojure

Thank you very much. I’ve just edited deps.edn with :main-opts ["-m" "cognitect.test-runner" "--dir" "src/test/clojure"] so I don’t have to type the path. And it works! :wink:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.