I am
Hi. Why test-runner has no clojar version, but only gitlib? https://github.com/cognitect-labs/test-runner
presumably you're using this test runner because you're already using clj
tooling
doesn't need an artifact, so there isn't one
speaking of test-runner, I was planning to spend a couple hours on it this afternoon triaging tickets and doing some clean up if anyone wants to draw my attention to anything about it
I'm using it with a lot of pleasure. That it's a git dep will give some people the impression that it's less stable than a mvn artifact, which is maybe ridiculous, but this is how some libraries are now developed: git = experimental, artifact = official. I know you're going to disagree with this, but it's what I perceived in the community.
It's not a problem for me personally. I also use the cljs-test-runner which reflects the same kind of API, which is great in a .cljc project.
Whenever I see a git hash, I too think it's less stable (be that justified or not), I graviate towards things that have a version on them.
I wanna specify the -d flag to the clojure test runner and specify that option in deps.edn. Is that possible?
it is
:main-opts
I was thinking :main-opts is something influencing clojure.main directly.
I will at least be adding a tag with a version number
hoping to start changing that perception in the community soon :)
I see, it dispatches on the first toggle being -m, -r or whatever.
@alexmiller it would be nice if test-runner was -X
-compatible
I'm going to look at that too
added an issue for it https://github.com/cognitect-labs/test-runner/issues/28
would leave existing support so would be additive
Here’s what we have at work, to be able to use it via -X
:
(try
(let [{:keys [fail error]}
(runner/test
(cond-> options
nsrx ; need to turn strings into regexes:
(assoc :namespace-regex (into #{} (map re-pattern) nsrx))))]
(System/exit (if (zero? (+ fail error)) 0 1)))
(finally
;; Only called if `test` raises an exception
(shutdown-agents)))
^ @alexmiller and we have that in a function like this:
(defn test
"Invoked via exec-fn (-X) and accepts the same options that Cognitect's
test-runner uses:
* :dir -- set of directories containing tests
* :namespace -- set of namespaces to test
* :namespace-regex -- set of regex strings to match namespaces
* :var -- set of fully qualified symbols to run tests on
* :include -- set of test metadata keywords to filter on
* :exclude -- set of test metadata keywords to exclude
Mimics part of test-runner's -main function regarding
exit code and shutdown."
[{nsrx :namespace-regex :as options}]
thx
What’s the benefit of -X when -M have all the equivalent functionality?
Some people prefer one over the other, so now you can choose