polylith

Nikolas Pafitis 2024-08-04T17:00:06.477409Z

How do run polylith-kaocha in watch mode?

imre 2024-08-05T08:45:55.049709Z

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.

imre 2024-08-05T08:47:25.088929Z

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

imre 2024-08-05T08:47:58.979069Z

in p-k kaocha "processes" (classloaders in reality) are short lived and are driven from polylith itself

imre 2024-08-05T08:48:16.880249Z

it's polylith that has the knowledge of files

imre 2024-08-05T08:48:43.545109Z

certainly an interesting topic

Nikolas Pafitis 2024-08-05T18:03:32.177149Z

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.

imre 2024-08-05T19:28:25.124139Z

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

Nikolas Pafitis 2024-08-06T17:38:14.149179Z

I guess that's true, I'm usually running tests through the REPL anyways most of the time

imre 2024-08-07T13:15:51.289469Z

I could imagine a scenario where kaocha could be tweaked to run watch mode inside your repl

Nikolas Pafitis 2024-08-04T22:17:38.164149Z

I tried using a tests.edn like so:

#kaocha/v1
{:watch? true}