Fork me on GitHub
#kaocha
<
2019-11-25
>
mogenslund12:11:09

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.

plexus14:11:29

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.

mogenslund18:11:12

Ok. Thank you for the answer 👍

dominicm16:11:00

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

plexus17:11:12

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

bin/kaocha --config-file my_config.edn

plexus17:11:45

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

plexus17:11:11

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

😜 4
tanzoniteblack22:11:03

@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))))

👍 4
mogenslund06:11:59

That is great, thank you! I will see if I can use the approach to add some "breakpoints" here and there 🙂 👍

plexus13:11:37

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