Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Show how to run from CLI with tools.deps #51

wants to merge 1 commit into from

Conversation

aviflax
Copy link
Contributor

@aviflax aviflax commented Jun 25, 2018

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 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).
@camdez
Copy link

camdez commented Jul 29, 2018

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. ¯_(ツ)_/¯

@weavejester
Copy link
Owner

Would a eftest.main namespace with a -main function make this process easier?

@aviflax
Copy link
Contributor Author

aviflax commented Jul 29, 2018 via email

@aviflax
Copy link
Contributor Author

aviflax commented Jul 30, 2018

@camdez clever!

@arichiardi
Copy link

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 clojure -m usage not with lein.

@weavejester
Copy link
Owner

@arichiardi Have you remembered to (shutdown-agents)?

@arichiardi
Copy link

arichiardi commented Oct 6, 2018

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.

@aviflax
Copy link
Contributor Author

aviflax commented Apr 17, 2019

Seems @weavejester would prefer a eftest.main namespace with a -main function.

@aviflax aviflax closed this Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants