Fork me on GitHub
Noah Bogart13:03:37

is it possible to exit a single test early? I want to be able to say (deftest sample (is-2 (= 1 2) "Stop here please") (is (= 1 2) "Never checked")) and have the second is not ran because it early exits but while still running all of the other deftest s


as a cheap trick you could wrap each is in an assert Without a helper like that, you'd have to hack the clojure.test multimethods. implements fail-fast (at deftest level; not at is level) so you can take some inspiration from there

Noah Bogart18:03:20

I can't find anything about fail-fast in circleci.test. have a line number for me to look at?


slightly misremembered :) it's not implemented there, but I hacked locally and also reflected my technique here

👍 3
Noah Bogart18:03:56

oh i see, this is about aborting all future deftests if a given one fails. yeaeh that would be helpful but is different than i'm looking for. i'll pursue modifying/writing a wrapper for deftest. thank you!


Kaocha implements fail-fast at the "is" level, we throw/catch a custom exception to break out of the current deftest.

Noah Bogart11:04:41

That’s cool! I’ll check out Kaocha