This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-07
Channels
- # announcements (32)
- # asami (1)
- # babashka (127)
- # beginners (135)
- # bristol-clojurians (1)
- # calva (21)
- # chlorine-clover (5)
- # cider (2)
- # clara (9)
- # clj-kondo (24)
- # cljsrn (2)
- # clojure (25)
- # clojure-australia (4)
- # clojure-europe (135)
- # clojure-nl (8)
- # clojure-russia (3)
- # clojure-spec (4)
- # clojure-uk (9)
- # clojurescript (55)
- # cursive (6)
- # datomic (62)
- # events (1)
- # fulcro (1)
- # helix (19)
- # jobs (3)
- # jobs-rus (1)
- # kaocha (8)
- # malli (6)
- # meander (3)
- # off-topic (2)
- # pathom (3)
- # podcasts (1)
- # polylith (3)
- # practicalli (3)
- # re-frame (4)
- # reitit (5)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (9)
- # ring-swagger (1)
- # shadow-cljs (59)
- # xtdb (4)
Hi. Why test-runner has no clojar version, but only gitlib? https://github.com/cognitect-labs/test-runner
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.
I will at least be adding a tag with a version number
hoping to start changing that perception in the community soon :)
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?
@alexmiller it would be nice if test-runner was -X
-compatible
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}]
Some people prefer one over the other, so now you can choose
A concrete benefit : main opts do not merge, exec args do. So you can use different aliases and combine arguments. We leverage that at work. You can't combine main opts like that.
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