cljx
cljx copied to clipboard
Wrong test selector used with lein do clean, test
I've recently switched to @cemerick's 0.5.0-SNAPSHOT. version and using :prep-tasks [["cljx once"] "javac" "compile"]
. When running the above lein command chain it does correctly generate cljx transforms, but the test command is then invoked for the 'user' ns only, even if I specify the :all
test selector... running lein clean
and lein TEST
separately works fine though.
This has nothing to do with selectors: Leiningen determines which namespaces to test before it "preps" a project, and that namespace-scanning process only looks at .clj
files.
Given advice that lein hooks should no longer be used, and the need to use prep-tasks to ensure proper jar generation, I'm not sure how to best go about this.
FWIW, I always have an explicit aliases for testing, deployment, and other operations, so as to not leave things up to chance, e.g.
:aliases {"cleantest" ["do" "clean," "cljx" "once," "test," "cljsbuild" "test"]}
More verbose, yes, but this allows me to know for sure what is going to happen.
I'm open to advice on how to make this all more user-friendly given the constraints we're working with from Leiningen.
A fix for this will require patching Leiningen. This looks like a small change, probably perfect for anyone looking to contribute back.
See technomancy/leiningen#1782