-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show how to run from CLI with tools.deps #51
Conversation
I tested this on my project, and it works for me. It should theoretically be possible to create a profile in a project’s `deps.edn` that would pass a `-e ...` argument to `clojure.main` that’d be identical to that added herein, but I haven’t been able to figure out how; I always run into some Bash quoting problem that is beyond my Bash skills to debug. Apart from that possibility, the other options that I’m aware of for using eftest in a project using `deps.edn` are to either add a `main-` function to eftest (as in #43 and #44) or to add a test-runner-runner namespace/script to the project under test (which is what I’ve done in my project).
I messed with the quoting situation for a while yesterday and also wasn't able to wrangle it. I'm actually convinced it's not just a matter of Bash quoting. While I didn't get to the bottom of it, I did come up with a hack that works—leveraging the fact that Clojure considers commas whitespace: {:aliases {:eftest {:extra-deps {eftest {:mvn/version "0.5.2"}}
:extra-paths ["test"]
:main-opts ["-e" "(require,'[eftest.runner,:refer,[find-tests,run-tests]]),(run-tests,(find-tests,\"test\"))"]}}} Kinda gross but functional. ¯_(ツ)_/¯ |
Would a |
Definitely!
|
@camdez clever! |
I have created a runner in my code but I have noticed that the JVM stays open after they finish, hanging. Has anybody noticed that? Just wanted to be sure before opening an issue. It only happens with |
@arichiardi Have you remembered to |
Oh, no - it might be that - thank you! EDIT it wasn't that, but my tests are including a lot of async stuff so there could be something else going on. |
Seems @weavejester would prefer a |
I tested this on my project, and it works for me.
It should theoretically be possible to create a profile in a project’s
deps.edn
that would pass a-e ...
argument toclojure.main
that’d be identical to that added herein, but I haven’t been able to figure out how; I always run into some Bash quoting problem that is beyond my Bash skills to debug.Apart from that possibility, the other options that I’m aware of for using eftest in a project using
deps.edn
are to either add amain-
function to eftest (as in #43 and #44) or to add a test-runner-runner namespace/script to the project under test (which is what I’ve done in my project).