leiningen

2022-12-12T21:53:38.488849Z

Does the leiningen test runner exist as a separate library anywhere? I'd like to use it in a Clojure CLI project 🙊

souenzzo 2022-12-13T09:35:10.298089Z

clj -Sdeps '{:deps{leiningen/leiningen {:mvn/version "2.9.10"}}}' -M -m leiningen.core.main test The actual way: add leiningen/leiningen {:mvn/version "2.9.10"} to your :test profile, and call clj -A:test -M -m leiningen.core.main test ...

đź‘‹ 1
vemv 2022-12-13T09:37:00.486409Z

I'd be surprised if that worked - doesn't Lein parse projects and apply project-evaluation / profile merging rules?

souenzzo 2022-12-13T09:41:11.756249Z

IDK how it will handle the classpath (actually IDK how lein handle the classpath). I think that for bigger projects, it will require a project.clj

vemv 2022-12-13T09:45:13.513319Z

Yeah, I mean, having a project.clj that duplicates deps.edn content is probably besides the point of OP. Anyway, there's a recipe for that... use Lein's dynamism to slurp deps.edn. This is my generic project.clj that I tend to add to deps.edn -based projects: https://gist.github.com/vemv/b33256a889dcfd95e8ded64c52dd907e (it has worked for me over the last couple years. No guarantee though. There's also a plugin)

eskos 2022-12-13T12:27:28.442019Z

I’ve always treated https://github.com/circleci/circleci.test as Leiningen’s test runner’s spiritual successor, so maybe that could work?

👍 1
2022-12-13T14:03:29.289039Z

I'll try that out too, thanks. I suspect I'll just have to bite the bullet and force us to switch to something else (cognitect or kaocha or circleci), lol, just gonna make some people complain

vemv 2022-12-13T03:35:25.241939Z

I'd love the opposite (use cognitect test runner from Lein) but they won't cut a mvn release 🥲 I'd say that Lein's test.clj it's very far from extractable without some substantial refactoring first. So you'd be better off with cognitect or kaocha. In the end, as you may know well clojure.test nowadays is sort of an interoperable standard, so the runner doesn't matter as much!

2022-12-13T03:46:00.667639Z

that's all true but the :only and test selector command line interface is just what i'm used to and what my team is used to, so as i try to transition us from lein to clojure cli, i'm trying to smooth over some of these edges

vemv 2022-12-13T03:58:13.346739Z

:includes - coll of test metadata keywords to include this opt sounds easy enough to adopt?