Fork me on GitHub
#kaocha
<
2022-03-23
>
henryw37410:03:58

Hello. I have a coverage build set up with :kaocha.plugin/cloverage and running that with bin/kaocha is working fine (produces html repl, prints out a table of results etc). If I invoke that build via (kaocha.repl/run :coverage) (ie all same opts coming from tests.edn) it just does a normal test run - no html produced etc. Is there something special one needs to do to make this or other plugins work when invoked via kaocha.repl ns?

plexus10:03:26

You're right, that doesn't currently work. The cloverage plugin uses a custom main hook to hand over control to Cloverage. We don't currently handle that hook in kaocha.repl.

plexus10:03:53

try something like this

(slingshot.slingshot/try+
 (kaocha.plugin.cloverage/cloverage-main-hook (kaocha.repl/config))
 (catch :kaocha/early-exit m
   (prn m)))

henryw37410:03:25

cool that runs. now just trying to see how to change that to select only the coverage test config

plexus10:03:22

you should be able to pass the same options to config

(kaocha.repl/config :coverage)

henryw37410:03:22

looks like kaocha.repl/config takes a map of extra opts

henryw37410:03:08

I can call it with no args and filter the test suites in it to the one I want - that works

plexus11:03:45

how about (kaocha.repl/config {:focus [:coverage]})?

henryw37411:03:06

that doesn't work - the cloverage plugin removes any suites with skip key but doesn't do any other filtering