Fork me on GitHub
#polylith
<
2024-01-16
>
xlfe07:01:39

I wanted to say thank you for #polylith - it's been super valuable tool at work the past year 🙏 https://clojurians.slack.com/archives/C8NUSGWG6/p1705388225248539

🙌 11
polylith 10
2
tengstrand07:01:00

Thanks for an excellent and well written article about Polylith! I'm glad the architecture worked so well for you.

❤️ 2
imre07:01:30

I'd be really interested in how you integrated polylith with kaocha if you can share more details

james08:01:00

Love this article! ❤️ It’s an excellent introduction to the “why” of Polylith, combined with an incredibly useful real-world report of the benefits/challenges, as you’ve experienced them. Thank you for sharing it! 🙂

❤️ 2
xlfe10:01:25

@U08BJGV6E to sketch it out - we needed to primarily figure out how to use kaocha's test focus but we started with polylith-kaocha and weren't super confident at the start of building our own from scratch. So we've stuck with it up to now. The main problem we had to work around was trying to run different test stages - eg unit tests vs acceptance tests - these run at different places in our pipeline. we initially found that we couldn't get kaocha's test focus to work with polylith-kaocha (if it is possible, it was entirely my fault we didn't figure it out LOL). We got it to work by creating a new "global test hook" component and made sure it was included in every project's deps.edn, that global component has a kaocha test.edn which is referenced from workspace.edn under :test, :polylith-kaocha/config-resource and in test.edn, we have a kacoha.hooks/post-load-test hook that references a post-load-test in the global test hook component. It's a bit convoluted, but essentially that post-load-hook is then run as part of polylith-kaocha's loading of kaocha config (I think). That hook checks if we want to run the particular kaocha suite (leaf) in the context of this test - we have different test stages in our CI/CD pipline like unit, acceptance, integration, etc - unit tests are by default anything with deftest, we then identify non-unit tests by annotating their form with some metadata, such as ^{:acceptance true} and that means when we run the acceptance tests, only those that are annotated that way are run, and the others we don't want to run are assoced with :kaocha.testable/pending true - we also had to override https://github.com/imrekoszo/polylith-kaocha/blob/a753ab14ab632bc913e782e5459296c6aff5659a/components/kaocha-wrapper/src/polylith_kaocha/kaocha_wrapper/test_plan.clj#L8 to not swallow errors which made debugging broken tests very very painful.

❤️ 2
imre10:01:22

Fascinating, thank you for the information! Others have also been looking for similar functionality so in case you can share a minimal repro I'm sure it would be appreciated. In case you have suggestions or patches for polylith-kaocha, I'd also love to see them.