Closed borkdude closed 2 years ago
:only a-ns
, if used in combination with a :patterns
option (often the case in a deps.edn usage), that is used in the ns-filter
and all namespaces are included instead of just the :only one.:only a-ns/a-var
, the namespace doesn't get required and the var can't be found.I find myself a bit on the fence about this change as it is already covered by use of the existing :nses '[a-ns]'
or :vars '[a-ns/a-var]'
(although the first of those has the same issue with :patterns
), and since these are both collection options they are definitely more onerous on the user to handle the quoting. I would still be willing to merge this, but the above issues need to be addressed.
@puredanger Addressed in new commit:
:namespace-pattern
option when :only
is usedtest
function so it's not specific to -M or -X usage:only
In the case of :only a-ns/a-var, the namespace doesn't get required and the var can't be found.
I could not reproduce that, I can see the namespace appear in :nses
that are to be required in the test
function and this is why I added a test for the only behaviour which does not seem to exhibit the bug.
As this option is considered "on the fence", I'm closing this. neil test :only ...
is now supported which forwards the argument to the cognitect test runner either as -v
or as -n
.
For people used to leiningen, the
:only
option can be convenient to run either a whole namespace or a single test from a namespace.Especially when paired with error reporting, where
:only foo.bar/baz-test
is printed whenfoo.bar/baz-test
is failing, so you can copy paste that in the command line.I did not include the printing in this PR, but can do another PR if that seems a good idea.