weavejester / eftest

Fast and pretty Clojure test runner
425 stars 40 forks source link

optional path argument for lein eftest #10

Closed facundoolano closed 7 years ago

facundoolano commented 7 years ago

Added an argument to the lein eftest task to allow specifying a path to test a specific directory or file.

weavejester commented 7 years ago

Can you explain the purpose behind this change?

facundoolano commented 7 years ago

Sure. Sometimes it's useful to be able to test only a specific file (or var or namespace), specially if you have a big test suite and you are currently focusing in just one part of it. In plain lein test you can pass an :only argument to specify a namespace (or even configure more complex test selectors), other libraries allow a ^:focus metadata to achieve a similar goal.

I've seen you get a fair deal of flexibility when using find-tests directly, but the lein task would only run the full test path (and updating that in the project file seems less convenient than a command argument).

weavejester commented 7 years ago

I'd like to make lein eftest to be a drop-in replacement for lein test, so rather than directories I'd rather re-use the test selectors that lein test has.

facundoolano commented 7 years ago

That makes a lot of sense. Would you be interested in a PR that adds that instead?

weavejester commented 7 years ago

I would indeed. There might be something in leiningen.test you can reuse.

facundoolano commented 7 years ago

Ok, I've reviewed leningen.test and I can barely follow the code, there's no way I can reproduce the test selectors behaviour in a different plugin.

I'm closing this PR since it does not fit with the project goals, hopefully @weavejester or someone else will add test selectors support eventually.

facundoolano commented 7 years ago

Ok, I've reviewed leningen.test and I can barely follow the code, there's no way I can reproduce the test selectors behaviour in a different plugin.

Actually after playing a bit with the code in leiningen.test I found most of the test selector functions can be reused. I'll probably send a PR later today.