How do run polylith-kaocha in watch mode?
I don't think it works right now. I never used watch mode with kaocha so supporting it was not among the objectives of polylith-kaocha.
I'm not even sure how it would work. See, in kaocha watch mode a long-running kaocha process watches for changed files, reloads them and reruns tests
in p-k kaocha "processes" (classloaders in reality) are short lived and are driven from polylith itself
it's polylith that has the knowledge of files
certainly an interesting topic
I think watch mode is definitely necessary, to save the jvm startup. Right now 99% of the time spent running tests in my projects is basically startup time. I guess in bigger codebases that the runtime of tests is much more significant than startup time, watch mode would still be good for rerunning only tests affected from changes.
P-k is for poly test really, which does not lend itself to watch mode, more for CI, but you're welcome to employ the various hooks pk has to implement it. Prs are welcome too.
Otoh I think watch mode is more analogous to poly's dev alias, and could be delivered without pk: the poly tool should be able to give you the source/test folders for dev mode which you can use to generate a tests.edn which then you can use with a kaocha process running outside of the poly process
I guess that's true, I'm usually running tests through the REPL anyways most of the time
I could imagine a scenario where kaocha could be tweaked to run watch mode inside your repl
I tried using a tests.edn like so:
#kaocha/v1
{:watch? true}