Closed frenchy64 closed 2 years ago
Oh, I didn't remember bat-test didn't have a main ns at all for Clojure CLI yet.
Is :exec-fn prefered over ns -main function now?
I'll want to ensure the lein version works as close as possible as this, so it would make sense to implement test-matcher-directories in the impl ns so it can be shared by both frontends.
Is :exec-fn prefered over ns -main function now?
It's hard to tell exactly, but Cognitect's test-runner seems to be encouraging exec. https://github.com/cognitect-labs/test-runner
I'll want to ensure the lein version works as close as possible as this, so it would make sense to implement test-matcher-directories in the impl ns so it can be shared by both frontends.
Will do.
Looking into providing a kv interface via Lein, eg., lein bat-test :watch true
for full feature parity.
My implementation of Leiningen test selectors is wrong, I need to go back to the drawing board.
I added a separator for lein bat-test
so you can provide selectors/namespaces in both styles.
lein bat-test foo.ns : :parallel? true
;; same as
lein bat-test : :selectors '[foo.ns]' :parallel? true
I really like this interface, saves a lot of typing. I'll try and port it to Clojure CLI with -M
.
Hi, what is the status now?
I see some problems with the Lein implementation, as the Lein namespace is using cli namespace directly, which requires c.t.namespace, which probably isn't available on Lein boot classpath.
I can probably fix those problems if the cli interface and the selectors work with Lein otherwise.
@Deraen I was thinking of one extra feature, but was having trouble implementing it. I think this PR is good enough to start with though, if you could fix the dependency issues for me that would be great. Then it's good to merge.
Here's the idea for an extra feature:
lein bat-test ./my-dir
watching tests in my-dir
. Distinguished from lein bat-test my-dir
because it starts with .
.
You could then alternatively do cd my-dir && lein bat-test .
.
@frenchy64 I tried fixing the cli
namespace uses from the Lein plugin code but wasn't successful.
Another problem is that the bat-test artifact is currently supposed to be used as a Lein or Boot plugin so that it won't have any dependencies and instead depends on the tool to add the dependencies vs. clj.
What would you think about just taking the CLI part and releasing that as a new project? I believe using the main namespace with Lein is becoming a popular way to support multiple tools (e.g., Kaocha and Figwheel-main).
Thanks for trying, I have no problem with making a new project!
Close #21 Close #31
This exposes most of
bat-test
via the REPL or Clojure CLI.There is an extra feature called
:test-matcher-directories
which only runs tests in particular directories. This is especially useful for huge projects that are split into many source directories, so you can easily boot up a watching tester for a subproject.It's implemented as a sugar for
:test-matcher
.The Actions build can be seen passing here.