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.
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.
Can I set up a watch ignore from the cli? The ignore is only for my setup
There's no command line flag for that, but you can do something like this
bin/kaocha --config-file my_config.edn
#merge[#include "tests.edn" {:kaocha.watch/ignore ["..."]}]
not sure I got the syntax right there but it's basically Aero which I believe you are familiar with 😉
Ok. Thank you for the answer 👍
@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))))
This is a great idea. You could even wrap that in a macro to turn those nested when blocks into something linear