Fork me on GitHub
#leiningen
<
2018-12-19
>
jimbob17:12:33

is there a way to call leiningen/test in the repl? use case: i have a jar im deploying but the jar does not know about clojure or lein (lightweight docker) I want to be able to call an entrypoint tht just runs certain tests. (perhaps a main function which calls leiningen/test

jimbob17:12:35

i want to be able to call something lke: lein test :smoke in a function that is an entrypoint for a smoke test docker image

jumar18:12:31

Not sure if that answers your question but you can call clojure.test - e.g. run-tests: https://clojure.github.io/clojure/clojure.test-api.html#clojure.test/run-tests

mikerod18:12:05

@ben.borders a jar you built wouldn’t have leiningen as a dependency, so it wouldn’t be available on the classpath

mikerod18:12:20

clojure.test is as mentioned and maybe that was all you were concerned with

jimbob18:12:33

sure, but also want to only run tests with :smoke metadata

jimbob18:12:35

maybe ill just bite the bullet and add leiningen / clojure to the dockerfile

mikerod18:12:07

yeah, if you are looking for the lein test sort of selector features

mikerod18:12:22

it’s mostly baked into the lein test task impl I believe

Jan K18:12:31

Is there a way to run some code automatically after lein repl is loaded? I think I saw something like that but can't find the relevant docs

mikerod19:12:46

@jkr.sw there is something called injections

mikerod19:12:10

:repl-options > :init (and :init-ns if you need a particular thing pre-loaded)

Jan K19:12:36

That should do it, thanks!

🎉 8