Fork me on GitHub
#kaocha
<
2022-12-02
>
onetom05:12:53

Is there a way to fail fast certain tests only? My use-case would be the same as @charliebriggs': fail-fast integration tests, but don't fail-fast unit tests. @charliebriggs has a discussion about this in the past, but there was no explanation what exactly has worked at the end: https://clojurians.slack.com/archives/CCY2V0U6A/p1605193008070800

onetom05:12:11

I haven't found any github issues about this question either amongst the results i got, when i search for fail-fast. Now we are keep switching the :fail-fast? flag in our tests.edn, depending on the desired behaviour, which is a bit annoying. We did mark our integration tests with a ^:behaviour meta tag and we did define a kaocha test suite, like this:

{:id         :behaviour
 :focus-meta #profile {:default [:behaviour :x]
                       :ci      [:behaviour]}}
I tried to put :fail-fast? into this definition, but as i gleamed from the kaocha sources, the :fail-fast? config option is only used during the test plan computation stage and adds an extra kaocha.report/fail-fast reporter implicitly to the list of reporters, so it wouldn't make sense to have a per-test-suite setting for it, assuming test suites share the reporter stack during a test run...

plexus09:12:52

should be doable with a wrap-run hook which binds testable/*fail-fast?* to true/false based on the current test.