Fork me on GitHub

Some issues on the kaocha repo with more info about what people's needs are would be great. We do have it on our roadmap to provide better monorepo support, see This would be fairly simple, a way of detecting tests.edn in nested projects and running the combined set of tests in a single process. No classloader separation which it seems polylith-kaocha does do. So I'm not sure to what extent this generic monorepo support would help polylith. I see only two open issues on polylith-kaocha so I assume that is working fairly well for people? ( Generally speaking any polylith specific stuff should happen in polylith-kaocha, *but* if polylith-kaocha needs certain affordances from kaocha to be able to do its job properly then we are interested in those, especially if they are generic affordances that could support multiple use cases.


polylith-kaocha does not expose kaocha-cli options. Actually, this is something that IMO would be needed.


the issue right now is most kaocha cli is private, not exposed interface. This means that if a project wants to integrate kaocha they need to: • A) make their own cli interface - people will need to learn it and they won't be able to reuse kaocha cli knowledge. • B) reimplement kacha CLI and try to follow kaocha - to benefit from existing kaocha cli knowlege. Right now maintenance in case B is quite big IMO


Can you elaborate? There's very little in kaocha that is private. But a cli interface meant for human consumption is not a good fit for building integrations on. That's why we provide kaocha.api. nothing's stopping you from calling kaocha.runner though or shelling out to kaocha.


That top level interface is very hard to reuse. We also have a separate kaocha-boot, because things are different when boot is in charge. It seems it's similar with polylith. It has its own cli tools and own rules.


nothing more concise right now


just the fact that I dropped to default test runner on polylith because I had some issues . Default poly test runner is not great either - with regard to features. I hope I get some time to look into this. Poly tooling is not mature on testing side.


poly has its own command line tool through which devs interact with it, for example running poly test which, in case of using the p-k integration layer would invoke kaocha through code. I'm not fully up to date on how poly handles extra arguments but I think for people familiar with the kaocha cli it could be useful to be able to call say poly test -- --focus 'my.test.ns' --fail-fast --reporter debug


It would help an integration layer like p-k to not have to parse what comes after the --, just pass an arglist to kaocha


that way the integration layer wouldn't have to know what args kaocha supports


I think polylith-kaocha's only job is to make kaocha accessible through poly test and not much else


and so it shouldn't need to understand more about how kaocha works


thanks @U08BJGV6E for explainig what I could not 🙂

Victor Millan16:09:48

Hi guys, thanks for all the work that you are doing with this project. We are surfacing this issue in our project. Should we create a new issue in github? Thanks one more time


I've reopened the ticket. Feel free to add more info if you think you can provide any extra useful information.


While working on polylith-kaocha I noticed that kaocha's 3 entry points (cli, -x, repl) seemingly reimplement common functionality with some subtle differences (like cloverage not being usable from repl/run). Because I wanted to support cloverage in p-k I had to again reimplement some of the stuff that -x does. @plexus would there be interest in spending some time refactoring the infrastructure around there so it's perhaps a little more straightforward to call a fully functional kaocha from code without the need to reimplement and without kaocha thinking it's being run directly from the command line?


Whether this would potentially be useful anywhere outside of polylith-kaocha, I don't know


I'm guessing kaocha was mostly written to serve as a sort of porcelain, not plumbing


It's a policy vs mechanism thing. Kaocha.api is mechanism (plumbing), it allows you to turn a test config into a test result, without caring how you end up with the config. kaocha.runner and kaocha.repl implement different policies about where the config comes from and what is done with the result (they are porcelain). That said there are some common things that could be handled in a middle layer, or in a utility namespace. A proposal for refactoring this is certainly welcome.


-X was added due to popular demand. I still do not see the point of it, and it does mean maintaining another entry point. People should use -m if they can.