Fork me on GitHub

Is there any tried integration between poly test and kaocha? The latter has a couple of useful plugins that we use and would like to keep in case of a switch to polylith.


I haven’t tried kaocha myself, but the poly tool supports adding setup and teardown functions to be defined, which are run before and after the tests are executed for a project.


The build in test runner only runs tests for code that has changed since the last stable point in time, which can save you a lot of time. The tool gives you plenty of options in how to run your tests, but if you miss some functionality, please let me know!


Hmmm I think I'll have to look into this deeper. kaocha is a rather advanced test runner that does its job well (has a plugin for automatic spec/fdef testing for example) and I'd love to integrate it into the poly workflow


And on the tool integration note, do you have a tried way to lint the entire monorepo with clj-kondo?


At work we have a :lint alias in the root deps.edn and then we run clojure -M:lint --lint ./bases --lint ./components --lint ./projects.


In ./deps.ednn :

:lint   {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2021.03.03"}}
         :main-opts  ["-m" "clj-kondo.main"]}


Ideally on the poly/kaocha integration I'd want poly to figure out which bricks (or namespaces?) need to be tested so that could be relayed to kaocha


thanks for the kondo config!


You can execute poly ws get:changes:project-to-bricks-to-test and poly ws get:changes:project-to-projects-to-testto see which bricks and projects that you need to run tests for.



👍 2
Matt Ielusic15:09:22

> clojure -M:lint --lint ./bases --lint ./components --lint ./projects Why do you lint the projects directory? Surely it has no code? Just deps.edn files and maybe some config?


It normally has a test directory where you put your project tests (created when the project is created).

👍 2

And clj-kondo can lint deps.edn files too, right?


I was just about to ask the same question about kaocha


since we also use that as our test runner


@U08BJGV6E @U096GDTLL I'm curious what you like about Kaocha compared to other runners, that you feel is missing from poly test?


i havent tried out poly test yet so its very possible nothing. We the kaocha extensions for cloverage and junit output as well. I am still very much in the research/understanding phase. Just getting questions figured out as they pop in my head, lol

Matt Ielusic21:09:11

> You can execute `poly ws get:changes:project-to-bricks-to-test` and `poly ws get:changes:project-to-projects-to-test`to see which bricks and projects that you need to run tests for. Hmm, Kaocha's --focus does not seem designed for focusing specific test files, and even specific tests, not specific directories. But I guess that's what its test suites are for


@U04V70XH6 Kaocha has a nice out of which we currently use: • filtering • pluggable reporting • randomize test order • profiling • plugins (cloverage, orchestra, automatic spec test generation) I has nice configurability and if you have it on the classpath in your repl session you can execute tests from there, using the same config you would get in ci or a command line run.


Thanks, I'll do that

👍 2

@U04V70XH6 I also found the that made me consider kaocha in the first place


@U1G0HH87L added my thoughts there


Thank for you feedback @U08BJGV6E!