kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
mogenslund 2019-11-25T12:08:09.062700Z

Hi. Is there any way to abort a single test, in case of failure, but continue with the next tests? It seems I can only abort the whole suite on failure (fail fast). I have a lot of slow Selenium tests and if one of the steps fail, usually all succeeding steps will fail as well, making a lot of noise in the log and spending a lot of time due to the timeout given, each time an element is not found. The first failure is usually the only interesting failure.

plexus 2019-11-25T14:49:29.064900Z

No, that's currently not supported. It's tricky because the is macro swallows exceptions. We had to do some ugly hacks because of that to support the fail fast feature. This is one reason why Kaocha has a monkey-patch namespace.

dominicm 2019-11-25T16:29:00.065900Z

Can I set up a watch ignore from the cli? The ignore is only for my setup

plexus 2019-11-25T17:23:12.066700Z

There's no command line flag for that, but you can do something like this

bin/kaocha --config-file my_config.edn

plexus 2019-11-25T17:23:45.067400Z

#merge[#include "tests.edn" {:kaocha.watch/ignore ["..."]}]

plexus 2019-11-25T17:24:11.067900Z

not sure I got the syntax right there but it's basically Aero which I believe you are familiar with 😉

😜 1
mogenslund 2019-11-25T18:19:12.068Z

Ok. Thank you for the answer 👍

tanzoniteblack 2019-11-25T22:59:03.069600Z

@mogenslund, not specifically a kaocha way to support short-circuiting a single test in case of failure, but you can always take advantage of the fact that clojure.test/is returns the body it wraps, so we have a lot of code that looks like this:

(let [some-thing (compute-something)]
   (when (is (valid? some-thing) "Entire test is invalid without some-thing being valid"))
      (is (check-something-else some-thing))))

👍 1
plexus 2019-11-26T13:05:37.070100Z

This is a great idea. You could even wrap that in a macro to turn those nested when blocks into something linear