This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-16
Channels
- # announcements (19)
- # babashka (41)
- # beginners (9)
- # calva (1)
- # cider (28)
- # clerk (2)
- # clj-kondo (33)
- # cljs-dev (1)
- # clojars (32)
- # clojure (29)
- # clojure-europe (36)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (4)
- # clojurescript (33)
- # datahike (6)
- # datomic (44)
- # emacs (35)
- # fulcro (25)
- # hyperfiddle (22)
- # introduce-yourself (1)
- # java (11)
- # kaocha (7)
- # membrane (3)
- # off-topic (2)
- # pathom (7)
- # polylith (15)
- # portal (3)
- # squint (1)
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
Thanks for an excellent and well written article about Polylith! I'm glad the architecture worked so well for you.
I'd be really interested in how you integrated polylith with kaocha if you can share more details
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! 🙂
@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.