Closed facundoolano closed 7 years ago
Can you explain the purpose behind this change?
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).
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.
That makes a lot of sense. Would you be interested in a PR that adds that instead?
I would indeed. There might be something in leiningen.test
you can reuse.
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.
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.
Added an argument to the lein eftest task to allow specifying a path to test a specific directory or file.