This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-16
Channels
- # announcements (19)
- # babashka (13)
- # beginners (7)
- # calva (8)
- # cider (25)
- # clj-kondo (12)
- # cljsrn (7)
- # clojure (60)
- # clojure-australia (5)
- # clojure-europe (59)
- # clojure-france (14)
- # clojure-gamedev (2)
- # clojure-nl (1)
- # clojure-uk (7)
- # clojurescript (43)
- # community-development (8)
- # core-async (2)
- # cursive (15)
- # datomic (75)
- # deps-new (31)
- # depstar (1)
- # fulcro (6)
- # graalvm (53)
- # holy-lambda (1)
- # juxt (3)
- # jvm (13)
- # kaocha (8)
- # lsp (109)
- # malli (14)
- # off-topic (62)
- # pathom (11)
- # pedestal (12)
- # polylith (12)
- # releases (5)
- # sci (5)
- # shadow-cljs (15)
- # sql (16)
- # tools-deps (27)
- # vim (1)
- # xtdb (14)
Is it okay in kaocha for a plugin to declare a test suite failed? And if yes, where in the documentation could I find how to do that?
Your plugin would probably be a separate library, so it's up to you. Or are you asking if marking it as failed would break something? I'm pretty sure you can use a post-test hook or use post-test or post-run in your plugin to change the status of individual tests. Here's an example of using a hook to modify individual testables: https://cljdoc.org/d/lambdaisland/kaocha/1.0.887/doc/10-hooks#pre-test--post-test
I'm looking to write a plugin that would basically make the test run fail when there were no tests found/run in certain test suites. Thank you for the pointers. I was basically just trying to check whether this is ok or an anti-pattern
I can't think of any major issues with doing that, although I'd be interested in @U07FP7QJ0' thoughts.
I ended up doing this with a kaocha.output/error-and-throw :kaocha/early-exit
in the post-load
hook in the end, thank you for the help
@U08BJGV6E I’m a bit late to respond, but did this for https://github.com/lread/test-doc-blocks/blob/de783e9d467a7b4363271504a6fb2c6562167b06/tests.edn#L12
Thanks @UE21H2HHD ! I actually considered hooks at some point but ended up going with a plugin as I wanted the team to be able to just reference the plugin and get some default config out of the box (namely, which suited should be checked by default). The plugin is in a lib where we keep our build/test-time utilities.