During testing, I’m tracking some information in an atom. I’d like to dump that information after tests are finished. I’m attempting to accomplish this by writing a plugin-in (I already have a couple of plug-ins) and calling (leiningen.test/test project) followed by an invocation to my function. However, it’s not resolving my plugin.
(defn my-test [project & args]
(e/eval-in-project (update :dependencies (comp vec conj) '[leiningen "2.9.1"])
`(do
(leiningen.test/test project)
(my.ns/do-my-stuff))
'(require '[my.ns]
'[leiningen.test])))
I don’t think I should have to add leiningen to the dependencies, but in any case, I get the following
$ lein with-profile +test my-test
=> Syntax error (ClassNotFoundException) compiling at (/private/var/folders/41/...init12001243714997740553.clj:1:273).\nleiningen.my-testI’m wondering if I should be using eval-in-project … maybe there is something more straightforward.
Or, is that the lein command to run? Can I somehow “override” lein test and then run my function?
I need to obviously run test and my function in the same process to get the output.