leiningen

Joel 2024-08-14T15:11:43.096369Z

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-test

Joel 2024-08-14T15:34:23.708329Z

I’m wondering if I should be using eval-in-project … maybe there is something more straightforward.

Joel 2024-08-14T15:35:05.442199Z

Or, is that the lein command to run? Can I somehow “override” lein test and then run my function?

Joel 2024-08-14T16:15:02.066339Z

I need to obviously run test and my function in the same process to get the output.