Fork me on GitHub
#polylith
<
2021-09-03
>
imre14:09:47

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.

tengstrand14:09:27

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.

tengstrand14:09:54

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!

imre14:09:07

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

imre14:09:57

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

tengstrand15:09:08

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.

tengstrand15:09:29

In ./deps.ednn :

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

imre15:09:23

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

imre15:09:36

thanks for the kondo config!

tengstrand15:09:45

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.

imre15:09:07

nice

👍 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?

tengstrand15:09:07

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

👍 2
seancorfield16:09:59

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

Travis20:09:06

I was just about to ask the same question about kaocha

Travis20:09:17

since we also use that as our test runner

seancorfield20:09:32

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

Travis20:09:00

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

imre12:09:26

@U04V70XH6 Kaocha has a nice https://github.com/lambdaisland/kaocha#features 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.

imre12:09:48

Thanks, I'll do that

👍 2
imre12:09:35

@U04V70XH6 I also found the https://lambdaisland.com/blog/2018-11-02-test-wars-new-hope that made me consider kaocha in the first place

imre12:09:33

@U1G0HH87L added my thoughts there

tengstrand14:09:24

Thank for you feedback @U08BJGV6E!